playMaker

Author Topic: Animator actions stop working after deactivating/reactivating UI object [SOLVED]  (Read 1699 times)

uilk

  • Playmaker Newbie
  • *
  • Posts: 16
I'm currently making a UI that shows the player's inventory of collected creatures. The inventory involves a series of panels that play each creature's idle animation when it occupies the slot. See the below image but imagine the creatures are moving. I use an FSM to set the animator parameters that control which animation will be played. This works fine at first, but as soon as I hide the creature inventory and bring it back up I only get static images and all the Playmaker animator actions appear to stop working. Something about deactivating and then reactivating game objects seems to get their animator components "stuck". Any way to fix this?
« Last Edit: July 26, 2020, 09:00:37 PM by uilk »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Hi.
It probably some paramaters that are still in a certain state(value), when you disabled it.
then when enabled they will still have the same value.

Its hard to say whats going on without seeing the fsm and the parameters.

There is a global event 'Disable' you can use that.
Set the event to a state and then you can do some 'Set Animator...' to reset the values.

uilk

  • Playmaker Newbie
  • *
  • Posts: 16
Thanks for the response. I was able to solve the issue by resetting the parameters as you said but only with the addition of a small wait time (0.01 seconds) beforehand. I'm not sure why that fixed it but can't complain.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Hi.
Instead if wait you can use a next frame event.

but maybe you can do it differently.

You can use animator Play, to play a certain animation, this way you might not need to use parameters.