Different Character Controller

You can see that we create a reference to your controller at the top of the KPDisableManager script.

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

  • Change the Player reference field at the top to how you would disable your own controller, as everyone has some different

Any issues do send me an email and I'll be happy to help!

Similar to how I've done so below:

[SerializeField] private FirstPersonController player = null;
[SerializeField] private KeypadInteractor keypadInteractor = null;

public static KPDisableManager instance;

public void DisablePlayer(bool disable)
{
    if(player != null) 
    {
        player.enabled = !disable;
    }
    else
    {
        Debug.LogError("You may want to add the player object into the inspector slot of the Disable Manager - Or change this if you're using a different controller");
    }

    if (keypadInteractor != null)
    {
        keypadInteractor.enabled = !disable;
    }
    else
    {
        Debug.LogError("Add the keypad interactor script (Usually found on the Main Camera) to the Disable Manager");
    }
    KPUIManager.instance.ShowCrosshair(disable);
}

Last updated