Forum rules - please read before posting.

Disable Pathfinding after Loading a Saved Game

edited June 2022 in Technical Q&A

Hello!

At the moment, it seems that I can save a game while my Character is moving. Then, when I load the Saved Game, the character starts to walk to that point. I need to disable this so the character is always stationary when loaded ( as in the pathfinding was never saved nor does the Character have movement speed ).

I put in a set of actions that Engine Wait .1, Player Constrain Movement Disabled, Engine Wait .1, Player Constrain Enable and assigned this to the On Load for Scenes, which works, but I was looking for a more failsafe method.

Ideally I would like it so that if a Character is moving, you cannot hit Pause.

AC 1.75.2 Unity 2020.3.32f1

Comments

  • You can assign an ActionList in your Load menu's SavesList element to run after the game is loaded, and in that ActionList add a Character: Move along path Action that uses the Stop Moving command to halt the Player.

    Preventing the Pause menu from being available whenever the Player is moving would require a custom script, e.g.:

    using UnityEngine;
    using AC;
    
    public class LockPauseMenu : MonoBehaviour
    {
    
        void Update ()
        {
            PlayerMenus.GetMenuWithName ("Pause").isLocked = KickStarter.player.IsMovingAlongPath ();
        }
    
    }
    
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.