Announcement

Collapse
No announcement yet.

Camera always flipping on pitch rotation (even in UE flying template).

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Camera always flipping on pitch rotation (even in UE flying template).

    Hi all,

    I am trying to expand on the Flying Template that is provided by unreal but I cannot work out why my camera is behaving in such a way. Can someone point on why the camera flips over if you rotate (pitch) the vehicle a certain amount (around 90 degrees). The camera is set not to follow the target pitch (only yaw), and it wont to until the pitch of the vehicle reaches a certain amount, and then the camera flips to the other side. I assumed there is a clamp setting somewhere thats making the camera behave this way but I cannot find it.

    Any help would be greatly appreciated.

    Thanks!

    #2
    Yes, by default this is the behavior of the camera in a player controller if you're using something like a spring arm. You have to create a custom Player Camera Manager class and assign it in your player controller, making a Player Camera Manager gives gives you options to adjust the min / max pitch in it's details. Adjusting these values should allow you to make it so the camera never flips by increasing the min/max pitch ranges. You could also do the reverse, if for example you didn't want the player to be able to look directly down at his feet when aiming in a third person shooter game.

    Conversely, I believe if you just parented a camera directly to the vehicle and told the player camera manager to use it when inside the vehicle, the camera will always follow the vehicle (it would be like someone glued a camera to the roof of the vehicle) You could use something like this: https://wiki.unrealengine.com/Camera..._in_Blueprints for this technique.

    But the first option I posted will give you more flexibility as the player will still be able to manipulate the camera's springarm rotation with their mouse/controller.
    Last edited by Deathstick; 03-11-2020, 04:45 PM.
    Indie Dev - Whiskey Cat Softworks
    Currently developing a colony survival game!

    https://twitter.com/WSoftworks https://www.facebook.com/WhiskeyCatSoftworks/

    Comment

    Working...
    X