I’m using OnCollisionStay to detect when my character (rigidbody) enters an empty GameObject, when he does, the camera changes to a top view of the area
My problem is that it seems to detect the collision multiple times, so the camera flickers between the two views, sometimes ending on the topCamera, other times ending on the sideCamera
Im using a simple function for the change
void OnTriggerStay(Collider other)
{
if (other.name == "bossArea")
{
sideCamera.enabled = !sideCamera.enabled;
topCamera.enabled = !topCamera.enabled;
}
}
is there a better method I should be using? Ideally it would be, if player enters boss area, change camera once, if player leaves boss area, change camera back