Hi,
I'm following the first-person tutorial to implement a cutscene, but I'm having an issue with camera orientation. Everything works fine until the cutscene ends, but then:
When the game switches back from the cutscene camera to the main camera, the main camera doesn't maintain the cutscene camera's final orientation. Instead, it resets to whatever direction it was facing before the cutscene started.
I've tested this with several different cutscenes, and the behavior is consistent - the main camera always returns to its pre-cutscene orientation rather than adopting the cutscene camera's final view.
Has anyone encountered this issue or know how to make the main camera inherit the cutscene camera's orientation?
Unity v. 2022.3.25f1
AC v. 1.81.4
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
It's not the MainCamera that's not rotating - but the First Person camera, which the MainCamera attaches itself to.
This behaviour is by design - the First Person camera, which is separate to the Cutscene camera, won't update outside of Player control unless directed to.
As the First Person camera is tied to the Player's position, what you can do is use the Character: Face object Action and copy the rotation of a Marker that's attached to the MainCamera. As the time it runs, the Player will then face (both spin and camera-pitch) the same direction as the MainCamera.
Or am I misunderstanding, and you're using Timeline to control the camera?
I'm using the Timeline to control the camera, like you did in your first-person tutorial for the intro.
And as an extra question to my previous post,
How about the situation where I'm moving the player to a different position during the cutscene? (it's a first person game) By default the camera returns to the starting position once the cutscene finishes. My guess is to use the Object Teleport action, but is there a better way? With the Object Teleport I'll have to create a marker and position it exactly in the last player position during the cutscene, which could be tricky.
Thanks for the details.
In both cases, you can rely on a simple custom script function to set the Player's position and rotation based on the MainCamera just before ending the Timeline.
Here's a sample script that should do it: copy/paste it into a C# script named PlayerToCameraSetter, and add it to a GameObject.
At the time you want to update the Player's position, call its ForcePlayerToCamera function. You should be able to do this from within Timeline using a Signal.
Perfect! It works!
Notice there was a small typo in the code:
In the PlayerToCameraSetter script you sent me. On line 17, it's trying to use a variable called "startPosition" but that variable doesn't exist anywhere in the code. I fixed it by changing it to "newPosition" (which is defined in the line above) and now it works perfectly. Simple typo, easy fix!