Changing Character Controller

  • You can see that we create a reference to your controller at the top of the “NoteDisableManager” script.

    • NOTE: You want to disable input and mouse look when you disable the player!

    • Change the "Player" reference to how you would disable your own controller

Similar to how I've done so below:

public class NoteDisableManager : MonoBehaviour
{
    [SerializeField] private FirstPersonController player = null;
    [SerializeField] private NotesInteractor noteInteractorScript =  null;

    public static NoteDisableManager instance;

    void Awake()
    {
        if (instance != null) { Destroy(gameObject); }
        else { instance = this; DontDestroyOnLoad(gameObject); }
    }

    private void Start()
    {
        DebugReferenceCheck();
    }

    public void ToggleRaycast(bool disable)
    {
        noteInteractorScript.enabled = disable;
    }

    public void DisablePlayer(bool isActive)
    {
        player.enabled = !isActive;
        NoteUIManager.instance.HideCursor(!isActive);
        noteInteractorScript.enabled = !isActive;
    }
}

Last updated