how to change orbit camera rotation when player runs into trigger box

I have recently created an object teleporter script that that teleports the player to specific location and it changes the player’s rotation if specified. Also, I want the script to tell the main camera to change it’s rotation when the player touches the trigger box. I have tried using:

Camera.main.transform.rotation = Quaternion.Euler(newRotation)

but nothing happens. (newRotation is a vector3 var)

Another thing is that earlier in this project, I accidently deleted the pre made Main Camera that comes with the start of the project. So I tried remaking the main camera by spawning one, naming it “Main Camera” and tagging it respectively like the original. I was wondering if this would be part of the problem whether Camera.main is not responding to this.

Thanks for the feedback guys, but I have already figured it out on my own. All I had to do was write:

Camera.main.SendMessage(function name, rotation values, don’t required feedback)

This worked out for rotating the camera to a new angle after teleporting.