playMaker

Author Topic: Continuous flying  (Read 2918 times)

jimbob

  • Playmaker Newbie
  • *
  • Posts: 2
Continuous flying
« on: October 23, 2012, 12:44:40 PM »
I am brand new to PlayMaker, Unity, and the development side but been doing modeling and animation for years.

Sorry for such a newb question, but I've been experimenting with PM and searching the forums and tutorials and can't find the answer. I've seen hundreds of posts on character controllers moving in XZ, but not any for XYZ. I want a flying character that continually moves with the camera attached (following). I've tried creating two FSMs - one with movement on XZ and one with YZ, but that didn't work. I don't want actual gravity as the flight is continuous, but inside a large box with collision as the boundary. Can I also limit the degree of pitch (I don't want the character to ever fly upside down or flip over)?

I know this is such a basic thing but am already stumped.
thanks in advance!

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Continuous flying
« Reply #1 on: October 23, 2012, 01:57:40 PM »
you can google for "mouse look" script for unity. It's the easiest way to achieve what you want. Then for the movement, you can create an FSM with an initial state which contains

1) a get key down action. Get the key W and send the event FINISHED. then in the next state, which follows after the first state FINISHES:
2) use the "translate" action and a "get key up" action. The translate action should work on the "self" space and have a positive value on the z axis. It should work per second and every frame.
then the get key up action should get W again, and send the event FINISHED and return back to the original state.

Now, with this and your mouse look script you should be able to fly for now. Character controllers are vastly complicated, and generally you would use one FSM to get all the input and then send global events to other FSMs to make them do the actual labor or stop it. Though people can do it however they like. Either way, playmaker can do just about everythin normal scripting can do, but it does not offer many "prefab actions" which let stuff magically happen. It all takes a bit of wicked logic :D

I hope that helped!

cheers,
kiriri
Best,
Sven

jimbob

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Continuous flying
« Reply #2 on: October 24, 2012, 06:22:45 PM »
Thanks Kiriri, I'll give that a try tonight!

And yes, i would like a prefab action that makes stuff "magically happen"  ;)

I followed the tutorial for the characterSimpleMove and was hoping there would be something just as easy or a just a setting I was missing on the SimpleMove.

Thanks again!

DARK_ETERNAL

  • Full Member
  • ***
  • Posts: 110
Re: Continuous flying
« Reply #3 on: November 14, 2012, 11:02:06 AM »
Did you try to disable the "Uses gravity" (or something like that) check in the rigidbody of your character? Your second FSM could manage a Y-axis movement only.
Check out our new game: Nitro Chimp. Now live in App Store!

Trailer:
Download: https://itunes.apple.com/app/nitro-chimp/id557150450?l=en&mt=8