playMaker

Author Topic: Basic Character Animation FSM setup  (Read 5549 times)

wyliam

  • Playmaker Newbie
  • *
  • Posts: 22
Basic Character Animation FSM setup
« on: April 17, 2011, 03:04:21 PM »
I'm admittedly new to FSMs, I've been attempting to replace the current "ThirdPersonAnimation.cs" script with Playmaker. I've a MoveFSM that moves the character and contains some anim switching actions. These anim switching actions change the animation state in AnimFSM. (See attached screenshots).

Currently the game crawls to a halt as the switch flips between "Basic Move" and "Update Idle" (or Walk/Run). Update Idle is a state that checks to see if the AnimFSM is in the Idle state already, and switches it if it isn't. Is this not the preferred method (constant state switch)? I don't want to wait for the animation to complete, as interruption will be expected.

Thoughts?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Basic Character Animation FSM setup
« Reply #1 on: April 17, 2011, 05:30:20 PM »
I posted a tutorial video showing the setup I normally use... On the road right now, but I'll look at your FSMs this evening...

marvmiller

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Basic Character Animation FSM setup
« Reply #2 on: April 18, 2011, 02:11:39 PM »
Is 'Get Controller Speed' a custom action?  I don't seem to have it..

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Basic Character Animation FSM setup
« Reply #3 on: April 18, 2011, 02:40:07 PM »
You can use Store Magnitude in Get Axis Vector. But I will add the ability to get the Velocity and Speed in Controller Simple Move, so you can use the speed after collisions...

wyliam

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Basic Character Animation FSM setup
« Reply #4 on: April 18, 2011, 06:03:41 PM »
Yeah- "GetControllerSpeed" is a custom action that returned the controller.velocity.magnitude instead of the velocity. I hacked it from "GetControllerVelocity".
BTW, I LOVE that I can create custom actions.

One thing that would be useful for first time users are better explanations of certain actions. For example, the "SequenceEvent" usage is a bit confusing. An example of it's use (written out would be fine) in the Action reference section (like Unity does with their script references) would be helpful. Just a suggestion.

@alexchouls: where is the tutorial video with your setup you referred to? Is that in the Simple Character Control thread?

marvmiller

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Basic Character Animation FSM setup
« Reply #5 on: April 18, 2011, 06:10:25 PM »
Cool, custom actions is definitely great! 

I think this was the video Alex was referring to:

wyliam

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Basic Character Animation FSM setup
« Reply #6 on: April 18, 2011, 07:29:25 PM »
Hot damn. I must've missed that video.

Thanks!