Forum rules - please read before posting.

"Move To Point" and "Always Run"

During one section of my game I want the player character to run everywhere. I am using Player: Constrain > Always Run. This works for general movement and hotspot 'walk to marker' movement, but does not override Character: Move to point actions with Move speed set to Walk. Is there an easy way to make it do that?

I realize I could use a variable check to decide between two Character: Move to point actions, one with Move speed = walk and one with Move speed = run, but I use a lot of these actions, so I am checking to see if there is an easier solution before I take on that task!

Thanks :)

Comments

  • This should be possible with a simple script that hooks into the OnCharacterSetPath custom event to modify the Player's isRunning variable based on their movement lock:

    using UnityEngine;
    using AC;
    
    public class RetainPlayerMoveSpeed : MonoBehaviour
    {
    
        private void OnEnable () { EventManager.OnCharacterSetPath += OnCharacterSetPath; }
        private void OnDisable () { EventManager.OnCharacterSetPath -= OnCharacterSetPath; }
    
        private void OnCharacterSetPath (Char character, Paths path)
        {
            if (character == KickStarter.player)
            {
                if (KickStarter.player.runningLocked == PlayerMoveLock.AlwaysRun)
                {
                    character.isRunning = true;
                }
                else if (KickStarter.player.runningLocked == PlayerMoveLock.AlwaysWalk)
                {
                    character.isRunning = false;
                }
            }
        }
    
    }
    
  • Yep! That's done the trick! Thank you very much, 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.