The function I’m trying to get to work is when the player hits the ‘Q’ key which is mapped to ‘IA_Glance’ the camera looks backwards to simulate the character looking behind them.
At the moment, this is working, except for the issue of the camera being centered, which it doesn’t unless you are centered before pressing the ‘Q’ key.
If the character looks anywhere but center of screen BEFORE pressing ‘Q’ key, then that is the direction the camera will end up looking, when I want it to be centered, not the direction the player was looking in before Q was pressed.
When the character releases the Q key the camera should re-center again anyway because the ‘Q’ key forces a centering of the camera, so no logic should be needed to center again after ‘Q’ key is released.
1 and 2 in the screenshot should be forcing a centering of the camera but it doesn’t, as the -180 forces the direction as I would expect.
3 does not center the camera as I would expect.
NOTE: I’m a month into my game dev journey so I might be asking some eye rolling questions!
Is this 3rd person? If so, the camera is, most likely, attached to a springarm (renamed to Camera Boom in the template), right? Shouldn’t you be rotating that instead? It meshes with Control Rotation the Player Controller, Pawns and their cameras mesh with.
Thanks for responding! it’s first person, I just started with the third person template, but there is a camera boom/arm thing too with the camera under it, those screenshots are correct just first person camera
Since this is first person, what do you need a springarm for then? How to script it would depend on which components inherits control rotation from a controller.
What’s this offset for?
So the head mesh geometry does not get in the way?
I broke the camera, not sure why it is doing this now I think its when I bound the camera to the head, but I want the head to cast shadows still but I also want it hidden when looking back so I can’t see the inside of his skull
It won’t allow me to do it with a Camera Actor only the Spring Arm which we deleted, anyway to do this with the Camera? couldn’t see an option for it based on my searches, First Person template is good but it doesn’t bind the camera to the head which I want for a more natural movement
This yields all wanted results except for the camera locking when facing behind them
Is it because the Spring Arm itself isn’t configured? if so, how would I do it? I’ve tried a few times with bad results
Camera centers when looking back (ideally it centers again when looking back)
Current version - it’s only looking 180 the other way from the current direction the player is looking before they hit the IA_Glance button, so there needs to be something that centers the camera before or after that button press.
For me, it center to my screen so am not sure what different , try to force a look forward with the SetControlRotation such that camera face similar to character forward.