Forum rules - please read before posting.

Actionlist conflict

I have a timer in my 3D game which runs an ActionList 'TimerEnd' on complete. This ActionList starts with having the Player face the camera.

I've run into some trouble if the timer ends while the Player is in the process of walking toward a hotspot which runs an ActionList involving an animation, e.g. picking up an object.

I discovered the 'ActionList: Wait for Preceding' action, which is great, and prevents any issues if the timer ends after the pickup ActionList has already started. In this case, the pickup animation completes, and then the 'TimerEnd' ActionList is run.

But if the Player hasn't yet reached the object, when the timer completes, 'TimerEnd' starts running, but the pickup animation also plays wherever the player is along their path.

I either want the walk to be interrupted so the pickup animation doesn't play, or I want the walk and pickup animation to complete before the 'TimerEnd' ActionList is run.

The only way I could find to potentially do it, is to have all interactions set to 'Cutscene while moving', but that's not ideal, because in normal gameplay I want to be able to interrupt an interaction while walking toward an object.

Any suggestions?

Comments

  • Interrupting the Player on their way to to the Hotspot can be achieved by beginning TimerEnd with a Character: Move along Path Action that uses the Stop Moving command on the Player.

    To instead have the game wait for the Player to first move to the Hotspot and play their interaction, but not have the movement be part of a cutscene, you'd need to rely on a custom Action.

    Installing this script (ActionWaitHotspot.cs) following the tutorial should provide this in the form of a new Player: Wait for Hotspot Action:

    using UnityEngine;
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionWaitHotspot : Action
        {
    
            public override ActionCategory Category { get { return ActionCategory.Player; }}
            public override string Title { get { return "Wait for Hotspot"; }}
    
            public override float Run ()
            {
                if (KickStarter.playerInteraction.GetHotspotMovingTo ())
                {
                    isRunning = true;
                    return defaultPauseTime;
                }
                isRunning = false;
                return 0f;
            }
    
        }
    
    }
    
  • Interrupting the Player on their way to to the Hotspot can be achieved by beginning TimerEnd with a Character: Move along Path Action that uses the Stop Moving command on the Player.

    There's always a simple solution that I just didn't think of. Thanks, Chris!

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.