I would like to disable player controls when it enters an area with a trigger!
Here is some rough pseudo code, but it should point you in the right direction.
public static bool PlayerControlsDisabled = false;
private void OnTriggerEnter(Collider other)
{
PlayerControlsDisabled = true;
}
private void OnTriggerExit(Collider other)
{
PlayerControlsDisabled = false;
}
You can then in your PlayerControls check if the bool is true or not
if (yourscriptname.PlayerControlsDisabled == false)
{
// Player controls in here
}