Using Different Character Controller
You can see that we create a reference to your controller at the top of the βCPDisableManagerβ 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 CPDisableManager : MonoBehaviour
{
/*Change the reference below here, to your own player script*/
[SerializeField] private FirstPersonController player = null;
[SerializeField] private ChessSystemInteractor raycastManager = null;
public void DisablePlayer(bool disable)
{
if (disable)
{
raycastManager.enabled = false;
CPUIManager.instance.ShowCrosshair(false);
/*Change the reference below here, to your own player script*/
player.enabled = false;
}
else
{
raycastManager.enabled = true;
CPUIManager.instance.ShowCrosshair(true);
/*Change the reference below here, to your own player script*/
player.enabled = true;
}
}
}
Last updated