Using a different Character Controller

In the DisableManager script, we reference the player controller and disable the FirstPersonController script so the player cannot rotate or move.

When we interact with the object we disable character movement and camera rotation. If you’re using a different controller please replace that reference with the way to disable your controllers movement and camera rotation!

My example scene has a variable called FIrstPersonController player = null;

  • This is reference the FirstPersonController script and we give it the name of player.

  • You can change FirstPersonController to the player controller you're using and how you would like to disable the camera movement and player movement.

    public class ExamineDisableManager : MonoBehaviour
    {
        [SerializeField] private ExamineInteractor interactorScript = null;
        [SerializeField] private FirstPersonController player = null; //CHANGE THIS
        [SerializeField] private BlurOptimized blur = null;
    }

In the snippet below, we can disable the player and camera movement by setting player.enabled = false because this will disable the FirstPersonController script. This controls both the player movement AND camera movement. This is where you would change those two statements accordingly!

If you have any issues at all, do send me an email! :)

        public void DisablePlayer(bool disable)
        {
            if (disable)
            {
                player.enabled = false; //CHANGE THIS
                interactorScript.enabled = false;

                blur.enabled = true;
                ExamineUIManager.instance.EnableCrosshair(false);
            }
            else
            {
                player.enabled = true; //CHANGE THIS
                interactorScript.enabled = true;

                blur.enabled = false;
                ExamineUIManager.instance.EnableCrosshair(true);
            }

Last updated