playMaker

Author Topic: Questions about FSM and Animator  (Read 1059 times)

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Questions about FSM and Animator
« on: July 20, 2019, 02:25:51 AM »
Hello,
I want to have complete control of the animator using FSM. In other words, showing what's happening inside the FSM to the player.
I got some questions:


1. Is it common to have an equivalent variable in FSM and the animator? Then, either it is to Set/Get from one to another.
Ex: 'playerSpeed' variable, 1 inside the FSM & 1 for Animator variable.


2. My current structure normally looks like the one in the attachment.
So mostly in every state, it ended with 'Animation' blocks of action. Is it better to separate visual FSM and process FSM?


3. Some actions like 'Animator Match Target' and 'Animator Start Recording' is somewhat unknown for me and with little information on how to use them. So I'm mostly using the 'Set' and 'Get' variable. Are there any Animator actions that you use frequently beside them?


Some insights will help a lot.
Thank you!

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Questions about FSM and Animator
« Reply #1 on: July 20, 2019, 08:47:00 AM »
I first did it as you do, but it became such a clutch, especially as I added that juice, particles, sound effects, screen shakes and whatnot. I unentangled this recently, and wrote about it here, also see posts above for yet more info.

I learned some more since then, for example from here. I now also do the jump arc entirely with a blend tree, as described there.

Summary: For example Jump: the player does jump (fsm with the mechanics), I send a global event to the player game object, including children. This way, all FSMs that would need to know about it (by listening to that global event) know that we're now jumping. An effects FSM with meaningful states sits somewhere downwards in the hierarchy and listens for that jump event. It then plays one single jump state where the clutch of stuff is placed, the sound effects, particles and so on. In there, I set animator state mostly directly, with Animator Cross Fade, and else use blend trees as much as possible (e.g. from idle to running is done with blend trees, not with any states).
« Last Edit: July 20, 2019, 08:50:01 AM by Thore »

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Re: Questions about FSM and Animator
« Reply #2 on: July 22, 2019, 04:24:59 AM »
Hello,
thank you for the answer!

Still not understand fully yet about the thread you link above, gotta try it first.

So, Animator Cross Fade can make the animation transition from one state to any state? (Without linking them with the white line.)
Haven't used it yet but somehow I think it will be good for action that interrupts the current state.