Forum rules - please read before posting.

ActionList/Animation Issues - Stopping Animations from Looping

Hi Everyone,
I'm using Unity 2020.1.1f1 and Adventure Creator v1.71.8.

I am animating in Unity with a Bone-Rigged Sprite Hierarchy character and Sprites Unity in AC. I am running into a couple different issues as I try to run two animations at once. In the scene, my character picks up a pot from the stove. I am trying to make it so that the animation for the character and the animation for the pot run simultaneously. I have set up a hotspot actionlist in which the Character: Animate and Object: Animate are run simultaneously.

The issue I'm running into is that I can't seem to get the pot animation to end/the pot object to become invisible after the animation plays. I have tried this a few different ways. First I tried adding an Object: Visibility setting the pot to invisible to run directly after the animation. This is in Action List 1 Here. When I do this, the animation either plays over on a loop, or occasionally the whole object becomes invisible before the animation plays the first time.

I have also tried creating three animations for the pot: one stationary, one being picked up, and one invisible. I tried to run the invisible animation after the prior one. This way worked somewhat better but it still briefly flashes the stationary pot in its original place before disappearing. This is in Action List 2 Here. I also tried a few other tactics, such as removing the object from the scene and teleporting it after the animation, and switched the animation to Sprites Unity Complex, but to no avail. Am I missing something about how best to stop animations or hide objects when not needed?

Thanks!
Adam

Comments

  • Having three separate animations sounds like the best way to go, but you don't need to manually trigger the "invisible" animation with a separate Action.

    In your Animator Controller, create a transition from the "picked up" animation to the "invisible" animation. Give it an Exit Time of 1 and a Transition time of 0 - so that the transition occurs instantly once the "picked up" animation has played.

    Then, just be sure to also attach a Remember Animator component to it, so that the state of this Animator (and hence its visibility state) is stored in save game files.

  • Perfect, that worked, thanks @ChrisIceBox!

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.