Forum rules - please read before posting.

Pause mechanim?

Is there any way to pause/continue animation with adventure creator?

Thanks

Comments

  • Welcome to the community, @chungaflomper.

    As in, midway through an animation? And this this for a character or some other object?

    If the animation is to be paused at a pre-determined point, it might be best to separate the animation into two clips and rely on Transitions / Parameters in your Animator Controller to delay the transition of the second half of the animation from the first.

    If you're looking to pause at any point in the same animation clip, you'll need to rely on a custom script as this is the best way to handle playback speed changes in Unity. This would typically be a case of setting the Animator's speed property to zero, i.e.:

    GetComponent <Animator>().speed = 0f;
    

    Using AC, however, you can wrap this into a pair of functions to pause/unpause the Animator that are then called via an AC ActionList.

    For example, attach this script (PauseAnimator.cs) to your Animator:

    using UnityEngine;
    
    public class PauseAnimator : MonoBehaviour
    {
    
        void Pause ()
        {
            GetComponent <Animator>().speed = 0f;
        }
    
        void Resume ()
        {
            GetComponent <Animator>().speed = 0f;
        }
    
    }
    

    You can then use AC's Object: Call event Action to reference this GameObject's component to trigger its Pause and Resume functions when desired.

  • It's just to pause an object animation at any time. A rotating windmill , click once to start spinning , click again to pause the rotation.
    The custom scripts should work thanks, I'm not much of a coder, but i do use playmaker also.

  • Wow, It's working! Incredible. Powerful stuff.Thanks Chris. Good to finally be here.

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.