The character has both Rigidbody and Box collider. I used cubes which I named for example Trigger01Forward and Trigger01Back which has box colliders but it was set as Trigger where the character can walk through it. The script as a generic to operate on all the cameras requires dragging the camera number to turn on and the Camera Number to turn off in the Inspector tab. However, when the character walks through the triggers the cameras do not change. The attached image gives a better understanding which also includes the C# coding. Could use some advice and assistance.
It would help if you provide more information on what steps you have taken to narrow down the issue so we know where to look for the problem.
Is the collision detected at all? Does it successfully match the tag? For example, if you add a Debug.Log inside the other.tag == “Player” does it print?
void OnTriggerEnter(Collider other)
if(other.tag == "Player")
Debug.Log("Collision detected with player");
Debug.Log("Camera states changed");
Thank you for the input. The console does print out collision detected and the Camera states changed. Basically having to modify the triggers. While researching I did run across a video on Cinemachines State Driven Camera system. Since this will be an action-packed system, while at the same, building up my grandchildren’s critical thinking skills on mathematics and decision-making process, I may wind up doing two different versions of this, one with camera changing by triggers and the other trying out the Cinemachine State Driven Camera system in order to compare which provides the better angles for actions scenes and etc. Thank you for the input and the two lines of code.
Okay, if that did not help you solve the issue it narrows down the troubleshooting field a bit more. Your image is very blurry so I can’t see much detail there. Is it the camera component or game object that is deactivated? I noticed that you’re activating and deactivating game objects, so if it is the camera component on the game object that you have deactivated, this would not turn it on. If you look in the inspector after entering the trigger, are those game objects disabled/enabled? Is the camera you’re disabling from your script the active camera that is displaying the screen? That is if you disable this camera manually, does the game view go blank with the no camera rendering text?