Changing Character Controller

When we interact with the padlock we disable character movement and camera rotation. In the DisableManager script we reference the player controller so we can disable the FirstPersonController script.

NOTE: If you’re using a different controller please replace these lines with appropriate for you, as can be seen below from the comments. Create a new reference to your character controller and disable movement and camera rotation for your controller.

public class PLDisableManager : MonoBehaviour
    {
        [SerializeField] private FirstPersonController player = null; //EDIT THIS
        
        public void DisablePlayer(bool disable)
        {
            if (disable)
            {
                player.enabled = false; //EDIT THIS
                //OTHER LOGIC
            }

            else
            {
                player.enabled = true; //EDIT THIS 
                //OTHER LOGIC
            }
        }
    }

Last updated