playMaker

Author Topic: A simple third person controller  (Read 32285 times)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3985
  • Official Playmaker Support
    • LinkedIn
A simple third person controller
« on: April 14, 2011, 09:32:01 PM »
I recommend watching at 720p...

« Last Edit: April 14, 2011, 09:50:00 PM by alexchouls »

GusM

  • Playmaker Newbie
  • *
  • Posts: 2
Re: A simple third person controller
« Reply #1 on: April 15, 2011, 06:44:38 AM »
Very useful, thank you.
This kind of easy, step by step, video-tutorials are very welcome by non programers.
Keep up the great work.

KarasuKen

  • Playmaker Newbie
  • *
  • Posts: 2
Re: A simple third person controller
« Reply #2 on: April 15, 2011, 06:00:33 PM »
So when you go into the run state it keeps the Vector3 direction for that state, and when you transition back to the walk it turns to where that state was last. what would be a good way to keep them from going back and forth?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3985
  • Official Playmaker Support
    • LinkedIn
Re: A simple third person controller
« Reply #3 on: April 15, 2011, 06:32:11 PM »
Good catch! That's actually a bug in the action. I've posted a bug fix: http://hutonggames.com/playmakerforum/index.php?topic=135.0

KarasuKen

  • Playmaker Newbie
  • *
  • Posts: 2
Re: A simple third person controller
« Reply #4 on: April 15, 2011, 06:34:12 PM »
Ah, awesome thank you!  :)

wyliam

  • Playmaker Newbie
  • *
  • Posts: 22
Re: A simple third person controller
« Reply #5 on: April 16, 2011, 05:09:09 PM »
This was pretty straight forward if you look at the examples provided in the build. Thanks for taking the time to show it step by step-

What would be VERY HELPFUL is if we could get an example flow of animation blends between states (walk/run/attack/etc). I've been at it for about a week now, trying to get my character to blend from state to state with a float switch and blend anim states.

Any suggestions?
« Last Edit: April 16, 2011, 05:23:46 PM by wyliam »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3985
  • Official Playmaker Support
    • LinkedIn
Re: A simple third person controller
« Reply #6 on: April 16, 2011, 05:23:50 PM »
Are you trying to do it in one FSM?

I would tackle this with 2 FSMs:

- The animation graph FSM: You can send events to this FSM to play animations, and set variables to control blends, animation speed etc.
- The controller FSM: Moves a "capsule" around, and sends events to the animation graph to switch animation state.

You should be able to test these separately. E.g., alt-click through the animation states to test them.

In my workflow, I like to test each FSM by hand and make sure it behaves correctly when you send it events and change its variables. Then hook the FSMs together when you're sure they're working correctly.

[EDIT] I'll make some more advanced videos soon, just want to cover the basics first.
« Last Edit: April 16, 2011, 05:32:22 PM by alexchouls »

wyliam

  • Playmaker Newbie
  • *
  • Posts: 22
Re: A simple third person controller
« Reply #7 on: April 16, 2011, 06:18:16 PM »
Are you trying to do it in one FSM?

[EDIT] I'll make some more advanced videos soon, just want to cover the basics first.

Yeah- I'm using two FSMS (Move/Anim) since they seem to be pretty separate in nature. However, my Anim FSM takes care of itself (which in retrospect seems odd since I'll want to override with action animations). The anims get into a pretty ugly loop of starting a blend, and then looping back to the main state to see if it's still a valid animation to play based on speed. This seems to start the blend over again (or layer them on top of each other).
In either case it slows to a crawl pretty quickly.

An advanced video would greatly help, as the basics seem pretty simple to grasp (for the most part) :)

Darnen

  • Playmaker Newbie
  • *
  • Posts: 13
Re: A simple third person controller
« Reply #8 on: April 29, 2011, 02:54:37 AM »
I am having an issue with the movement fsm, I am not sure if it is on my side or if the script isn't working properly over all... Probably more likely I did something incorrect! heh, I have a screencast video link here http://screencast.com/t/EXeL9hvOz showing what it is doing exactly.

I did your video step by step and this is what it gave me with my characters rotation. Its very spastic, if I move the WASD in order example I hit W then D, S, A it will rotate properly but if I hit W then S or A then D it won't rotate it just moves the character back and forth. And I also noticed in your video the characters rotation Gizmo moves and points in the direction you are going, mine does not. So I thought I would ask and see if anyone is having the same problem or knows what the problem is.

Thanks.   

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • FluidPlay Studios
Re: A simple third person controller
« Reply #9 on: April 29, 2011, 02:16:35 PM »
I've seen the video, but since I haven't replicated the tutorial myself I can only offer an educated guess. I have done a full controller inside of Playmaker (ie. no scripts whatsoever) and some things that helped making things really smooth was:

- Making things that should run parallel use separate FSMs in the same machine. In your case I would try having "smooth look at" in a second FSM, running all the time yet sharing the direction since it's hosted on the same object. I do the same for things like "jump" and "fire".

- Split states with long action lists in two or more. That'll help you easily debug where things are going wrong. You can switch the debug mode from "Step Single Frame" to "Step Next State" (bottom left corner of the PM interface) and toggle a breakpoint or two, also helps a lot when pause/stepping the scene to debug.

Good luck!
--
Breno "MaDDoX" Azevedo
@brenoazevedo

Darnen

  • Playmaker Newbie
  • *
  • Posts: 13
Re: A simple third person controller
« Reply #10 on: May 02, 2011, 01:06:01 AM »
I will give it a shot, thanks.

karen1labero

  • Playmaker Newbie
  • *
  • Posts: 1
  • united statse
Re: A simple third person controller
« Reply #11 on: June 03, 2011, 07:01:01 AM »
this is a great phenomenon for all.

Cybershead

  • Playmaker Newbie
  • *
  • Posts: 7
Re: A simple third person controller
« Reply #12 on: March 09, 2012, 05:55:42 PM »
Everyone is in a maze of many turns, as a noob to unity i was looking for a great 3rd person movement. I found a great wow replica Camera but i could not find a great moment script. With only knowledge of Action script i looked at many tutorials and used my own script (Similar to Unity JS) but could only do the walk and jump and move about like i wanted too. The Jump i made ok, but the rest of the actions i got confused. So i saw Playmaker and it looked wow i can create with out thinking. But the 3rd person movement is not what i expected from a Hot program like this. Looking at the Playmaker tutorials their is some great stuff to easily implement to the game, So why is the most sort after script so poor?


Cybershead
If the path of life was made for us, why do we try so hard to change it?

amaranth

  • Full Member
  • ***
  • Posts: 172
Re: A simple third person controller
« Reply #13 on: March 28, 2012, 02:31:52 PM »
Thank you for this great tutorial!

Liquidman

  • Playmaker Newbie
  • *
  • Posts: 3
Re: A simple third person controller
« Reply #14 on: March 29, 2012, 10:10:13 PM »
I am having an issue with the movement fsm, I am not sure if it is on my side or if the script isn't working properly over all... Probably more likely I did something incorrect! heh, I have a screencast video link here http://screencast.com/t/EXeL9hvOz showing what it is doing exactly.

I did your video step by step and this is what it gave me with my characters rotation. Its very spastic, if I move the WASD in order example I hit W then D, S, A it will rotate properly but if I hit W then S or A then D it won't rotate it just moves the character back and forth. And I also noticed in your video the characters rotation Gizmo moves and points in the direction you are going, mine does not. So I thought I would ask and see if anyone is having the same problem or knows what the problem is.




Thanks.   

Hi Darnen,

change the "tool handles" from global to local.

Liquidman