I’m using “Set view target with blend” to switch view from player’s eyes to cutscene camera and then back to player’s (see below), but for some reason, when I do it my player’s camera sinks down into about half the height player’s height (also, see below).
Curiously enough, the problem doesn’t accrue if I move the camera in the editor before playtesting. If I change the position in any way, the camera will be positioned correctly until the next run and I have no idea why. Anyone knows what is happening?
Hey @V_vix!
So I can’t tell you WHY it’s happening, but I bet I could make a pretty accurate guess of what is happening functionally, and how to at least make a simple workaround
So what I believe is happening is the player’s camera is being set to 0,0,0 locally, putting it in the middle of your character. So what you can do is:
First, make a variable Vector called “SavedCameraLocation”
Before changing to the cinematic camera, GET your camera’s Location and Set “SavedCameraLocation” with it.
Now, when exiting the cinematic camera, you can grab your camera and SET its location. Try it right before giving the player’s camera back, and if that doesn’t work, try it right after giving it back.
*If that doesn’t work
It might be something to do with the camera’s SpringArm component, if you have one. But most First-Person games don’t.
Give that a shot and let us know how it goes! And if you need a walkthrough I can assist further!
I’m using a default first person template character movement from UE 5.1, so if that has spring arms, so does mine. As for saving camera’s location to a variable, I saved it’s relative position to a vector variable and used “set relative location” node to set the camera to where it was before the cutscene and unfortunately it still doesn’t return the camera to it’s proper place.
Did you try to set it after the player getting their camera back? Or before? It should definitely work AFTER. Are you sure you’re using the correct camera? Because it will create a camera to use if you aren’t specifically calling it.
I tried before and then after, neither worked. As to whether I did it properly, here you can take a look yourself. Connections are a bit messy, but it’s hard to keep them neat while moving them around constantly for debugging.
EDIT: I found something curious while looking for nodes: A variable like this
You think it might have something to do with my camera problems?
EDIT 2: After some testing: I could not find a correlation between the found variable and my problem.
I see the issue!
You need to input the camera as the “New View Target” like so:
You shouldn’t need the “Set Relative Location” after that
@V_vix That’s my bad!
I set up a mock-up of your code and was getting the same issue, figured it out. Edit: No I didn’t
Grab your Player Character and plug THAT directly in to SetViewTargetWithBlend! It will auto-find your camera if you have one on the player character (if it’s a pawn, use PlayerPawn, and if you have more than one camera on the character, find the one you want first and use “SetActive” to pick the camera)
Edit: I just realized I’ve gone full circle. This is exactly how it was set up at the beginning. Ugh.
Where are you calling this? If it’s outside the player character, you might need to use GetPlayerController → GetPlayerPawn and plug that into NewViewTarget
One More thing to check, are you at any point setting the camera on the FirstPersonCharacter to Active->False? Because that would mean there’s no active cam so it’ll default to making one at 0.0.0 @V_vix
No, using pawn as target doesn’t fix it. No, I do not edit Player’s component camera in any way at any point. Yes, I made a full circle.