Rotate camera on collision of character

Hi there, im trying to make a C# script for my 2.5d side scrolling game which allows my camera following the players’ character to rotate along with the character when it collides with a game object or a box collider (with no colliders so the player can pass through the object).

So as the character follows the path and hits a certain point, the camera and character will rotate 90 degrees along a different axis.

Any help would be appreciated!

put a script on the trigger that does exactly that. It has a reference to the camera and it changes its eulerAngles.

Camera.main.transform.eulerAngles = new Vector3(Camera.main.transform.eulerAngles.x, Camera.main.transform.eulerAngles.y, Camera.main.transform.eulerAngles.z + rotateAmount);