Forum rules - please read before posting.

Don't know how to deal with different sets of animations for same player

Hi ! in my game , the main player starts laying down in a hospital bed, and after some interactions, it can start walking .
While in bed his position is horizontal, and he has a set of animations, once stood up of course the position is vertical and he will be able to walk .. etc.
How can I achieve this in the game? I tried to create two different players , but couldn't find the way to switch between them once an event ocurred.
thanks!

Comments

  • hey, perhaps you can use mecanim to set bed animation in your aniamtor and prevent movement with engine:manage systems?

  • Have you tried using the ActionList item Player - Constrain - movement - Disable?

    You can also use a variables (bool) to instruct zero movement. For example you might have an 'idle_static' animation that leads to a 'getting up' and which would then lead to your normal idle, walk talk animations. I would have the entry animation as the idle_static with a bool set to false to prevent movement. Then when you want movement, use mechanim in an action list to switch the bool parameter to true. Keep the bool set to true and then revert the Player - Constrain - Movement back to enabled.

    I am assuming you're using 2D and the animator component though.

  • Welcome to the community, @marco.

    The Player: Constrain Action can be used to restrict player movement, but changing their animations is a case of using the Character: Animate Action.

    Essentially what you'll want to do is change your player's "standard" animations, i.e. idle and talk. How exactly you do this will depend on your chosen animation engine for the character.

    If it's Sprites Unity, for example, you can use the Action's Set Standard method to change the names of your expected animations so that different ones get played.

    Or if it's set to Mecanim, you can create a Bool parameter in your Animator named e.g. "IsLyingDown" that causes a different set of animations to play when True. The Action's Change Parameter Value method could then be used to set its value.

    It is also possible to use two different Players. If you set the Settings Manager's Player switching field to Allow, you can assign two separate Player prefabs (one standing, one lying down). Then use the Player: Switch Action to swap them at runtime, checking its Replace old Player's position? option.

    That's only general advice, though. If you're looking for more specific help, best share more details and screenshots showing what you have so far, and we'll see what needs to be done.

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.