Swapping Character Controllers
How to disable movement?
Last updated
Last updated
using UnityStandardAssets.Characters.FirstPerson;
[SerializeField] private FirstPersonController player;
public void DisablePlayerDefault(bool disable, bool isInteracting, bool isExamine)
{
if (disable)
{
//Code
if (isExamine)
{
blur.enabled = true;
}
if (isFirstPerson)
{
player.enabled = false;
}
if (isThirdPerson)
{
thirdPersonController.enabled = false;
thirdPersonRotator.enabled = false;
}
}
else
{
//Code
if (isExamine)
{
blur.enabled = false;
}
if (isFirstPerson)
{
player.enabled = true;
}
if (isThirdPerson)
{
thirdPersonController.enabled = true;
thirdPersonRotator.enabled = true;
}
}//Reference your character controller here, unless your controller solution comes
//with a better solution
[SerializeField] private FirstPersonController player;