Forum rules - please read before posting.

Container close animation set up

Hello, I was wondering which is the best way to set up the following interaction:
1. Player uses locker
2. Locker plays open animation
3. Container UI opens
4. Player exits container UI
5. Locker plays close animation

Well, I pretty much figured it out until step 3, but I have no idea how to set up the close animation. I was thinking about calling an actionlist when the player clicks the close button, but what happens when I have multiple lockers? or maybe even a chest? Can it be done?

Thanks a bunch!

Comments

  • Welcome to the community, @TehMasterdown.

    You can do this by using ActionList parameters do dynamically alter which object you want to animate in an Object: Animate Action.

    1. Create a new ActionList asset and add such an Action to have the locker play its close animation. Ideally this would be done by changing an Animator parameter value (e.g. an "IsOpen" bool = false).
    2. Create a new GameObject parameter in the ActionList's properties, and have it override the Action's Animator field.
    3. Have this ActionList run when the Container UI is closed. This could either be run as part of the Close button's ActionList, or by assigning it as the Menu's ActionList when turn off property.
    4. In step 2., when you play the locker-opening animation, use an ActionList: Run Action to call this new ActionList asset - but set the Run mode to Set Parameters Only. You can then assign the locker's Animator in the parameter field in advance - so that when it's run later, the correct locker will be animated.

    The only other thing to be mindful of is that ActionList parameter values won't be included in save files - so you'll need to prevent the player from being able to save while the container is open. This can be done with a pair of Engine: Manage systems Action to lock/unlock saving when the container menu is turned on/off.

  • Thank you SO much Chris! It works like a charm.

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.