Forum rules - please read before posting.

Help about Player switch

edited November 2018 in Technical Q&A
Hello everyone, I have a problem that I can not solve about the character's prefab. I created all the actions to make sure that the character, when he finds the flashlight, can equip it with a lock and unlock menu to see that the flashlight is active. The problem is that to succeed the only solution found concerns the switch of the character, but when it changes does not keep me the same animation that had before, making the switch snappy and unwatchable. I was wondering, is there a way to make the character continue the animation when the player is changed, or alternatively, a way to add the flaslight as a child's character without having to switch the same character?
Thanks a lot. Bukyja

Comments

  • edited November 2018
    You could hook into the OnSetPlayer custom event to try to set up their animation correctly, but it'd be fiddly and I wouldn't recomment it.

    Better to rely on a single character and just animate the flashlight's display.  It doesn't need to be added on as a child at runtime - just hidden from view by default.  An animation on a non-base layer on the Animator component can be played back independently of the rest of the character's animation.
  • Oh ok, animating the torch is probably the right alternative to which I had never thought, even if at first glance it seems a bit complicated I'll try. For now, thank you so much Chris, always useful. : D


  • edited November 2018

    Perfect, after a bit of tests I managed to do as you suggested. Everything works well in the starting scene, the only problem I noticed is that when I change the scene with the flashlight active when the next scene is loaded, it disappears leaving only the active icon. among other things, it seems that the torch is completely deactivated, leaving only the possibility to activate or deactivate the icon but without reappearing the flashlight. Maybe I should activate some "remember"? Any idea? Many thanks, Bukyja.
    P.s. I'm using translate, so sometimes it translate the torch but it means the flashlight XD

  • I'm sorry for the unnecessary question, I've already done several tests and I must say that the solution was quite simple, just added remember animator to the character. Many thanks again, Bukyja.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.