Forum rules - please read before posting.

Toggle for "Contrain: Free movement" stops player

I created an active input for toggling between walk/run while the player moves. It basically checks a boolean for if the toggle is on or not, then flips said boolean and switches between "Always Run" and "Free" depending on its state.

Switching to run while the player is walking works fine. However, switching back to Free during a run causes the player to stop dead in their tracks. Both toggles in the ActionList are exactly the same. Why would this be happening?

Comments

  • What are your Unity and AC versions?

    I'll attempt a recreation. Can you share images of your Settings Manager, as well as the ActionList(s) involved?

  • Running Unity 2020.3.26f1 with AC 1.74.5

    Settings Manager:

    ActionList

  • Thanks. So this occurs while the Player is moving due to point-and-clicking in regular gameplay?

  • Yes, toggling to a run in mid-walk works correctly. Toggling to a walk in mid-run just stops the player on a dime. They can still be controlled correctly after that, but it's weird.

  • I'll attempt a recreation.

  • The issue appears to be two-fold. Firstly, the Player should not be halting, as you've found. You can remedy this by opening AC's ActionPlayerLock script and replacing:

    if (KickStarter.player.IsPathfinding () && !ChangingMovementLock () && (doRunLock == PlayerMoveLock.AlwaysWalk || doRunLock == PlayerMoveLock.AlwaysRun))
    

    with:

    if (KickStarter.player.IsPathfinding () && !ChangingMovementLock ())
    

    However, setting the "Walk/Run" field to "Free" won't cause the Player to walk mid-movement. This is by design, since Free refers to the ability to freely both walk and run. If you want the Player to walk upon the Active Input being pressed, set this instead to "Always Walk".

  • That fixes it, thanks!

    To explain, I wanted to be able to give the player a toggle between always running/walking while still allowing them to use double-click to run. Setting to "Always walk" prevents this while Free does not.

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.