Preventing Camera Roll for Drive Ability (3rd person adventure)?

JohnG

Member
Is there a way to prevent the camera from rolling from side to side (z axis in case I am misunderstanding camera roll)?

I am looking to do this as the vehicle I am driving has suspension, so when I move left or right, the camera rolls with the suspension. Its about +-5 degrees, so not a huge amount, but enough to make it looks visually unappealing.
 
Have you tried applying a State whilst driving that vehicle, then assigning that state to a particular View Type within the Camera Controller? Inside of the View Type itself, you can adjust numerous values including rotation spring values, which may be what you are looking for.


 
Have you tried applying a State whilst driving that vehicle, then assigning that state to a particular View Type within the Camera Controller? Inside of the View Type itself, you can adjust numerous values including rotation spring values, which may be what you are looking for.



I have tested with the values that you suggested, it doesnt help. Here is a video of what I am experiencing.

As you can see, the camera is tilting to the left and right (use horizon as reference).


I have even created a dummy gameobject with zero z axis rotation and changed the transform in update (so it follows character). I then set the anchor to this gameobject, however there is still camera tilt even though the z rotation axis of the gameobject is 0 (the character is tilting).
 
The camera will change the roll when the character is aligning to gravity. In a future update I'll add an option so you can choose if it has this functionality.
 
In which part of the view type could I override the behavior? I would then create my own view type inheriting from adventure or third person.
 
FYI, I scrapped using the drive ability for opsive and instead used the camera on the vehicle asset I am using (NWH Vehicle Physics 2). I switched off opsive using EventHandler.ExecuteEvent(m_Character, "OnEnableGameplayInput", false); It seems to work well for me.
 
I created a new view type inheriting from Adventure. I then simply call the base class Rotate method and set the z component (roll) to 0. I think this is the most simple solution to stay compatible with any changes in the camera system.
 
I created a new view type inheriting from Adventure. I then simply call the base class Rotate method and set the z component (roll) to 0. I think this is the most simple solution to stay compatible with any changes in the camera system.
Can you please give more details on what exactly you did in the Rotate method?
 
I found the Align To Ground Roll Limit setting, is that it? But when I try to change the values, I fail, the values are always zero.
 
That is it. In the demo scene that parameter is enabled to keep the yaw at 0 when driving the vehicle
 
Sorry, but I don't understand how it works. In the demo scene, the camera does not jerk due to disabling the Update Character Rotation parameter when boarding a vehicle. But what if I need the camera to follow the direction of the player (that is, Update Character Rotation is on)?
 
Top