Forum rules - please read before posting.

Feature request? On single click while running player continues running

Sorry, I'm asking a lot of questions at the moment because I'm at the stage in the project where I have to deal with all the difficult stuff I've been pretending doesn't exist for three years...

I'm using standard point and click controls where single click makes the player walk and double click makes them run. Currently, if I double click to start the player running, then single click again before they stop, the player transitions back to walk. I would like them to continue running in this instance. So you double click once to start running, then while you are in running mode single click will move you around at running pace. Until you actually come to a stop.

Is there currently a way to achieve this? If not, I think it would be nice if there was...

Thanks!

Comments

  • I'm unsure about an official change - I think it's a bit too specific a behaviour to make optional, and I'm unsure how a default change would be met with others.

    Adding this behaviour through a custom script, however, is very simple:

    using UnityEngine;
    using AC;
    
    public class ContinuousRun : MonoBehaviour
    {
    
        void Update ()
        {
            if (KickStarter.player.isRunning)
            {
                KickStarter.player.runningLocked = PlayerMoveLock.AlwaysRun;
            }
            else if (KickStarter.player.charState == CharState.Idle)
            {
                KickStarter.player.runningLocked = PlayerMoveLock.Free;
            }
        }
    
    }
    
  • This gets the player running, but it isn't resetting them to walk after they reach a standstill. They just run forever after one double click.

    I also have the script you supplied here in play - https://adventurecreator.org/forum/discussion/12703/move-to-point-and-always-run#latest

    Could the two be clashing?

  • Very likely - you'll need to ensure only one is active at a time.

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.