Forum rules - please read before posting.

OnCameraChange ActionList

Is there a way to have an ActionList run whenever an AC camera change event occurs?

Or is there a script nugget I can use and I'll drop it on to each camera object?

Olly

Comments

  • You can hook into the OnSwitchCamera custom event to run an ActionList at this time:

    using UnityEngine;
    using AC;
    
    public class CameraChangeActionList : MonoBehaviour
    {
    
        public ActionList actionList;
    
        void OnEnable () { EventManager.OnSwitchCamera += SwitchCamera; }
        void OnDisable () { EventManager.OnSwitchCamera -= SwitchCamera; }
    
        void SwitchCamera (_Camera old, _Camera newCamera, float tt)
        {
            actionList.Interact ();
        }
    
    }
    

    To run an ActionList asset file instead of a scene-based one, replace ActionList with ActionListAsset.

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.