Unconstrained Character and Camera Rotation

ExqueezeMe

New member
I'm making an FPS where the player flies with a jetpack and can look in all directions. I want them to be able to control the camera using typical fighter jet controls (the camera should always rotate around local axes instead of the world Y axis, and should be able to go upside-down. I also need the character's body to rotate with the camera, although not necessarily instantly. So far I've tried using the FreeLook view type and allowing the player to rotate their view as normal within a small range, but having my Jetpack ability add a torque to rotate the character towards its look direction. This works well for the yaw angle, but aiming up or down causes the camera to maintain it's local rotation and thus the character to keep rotating indefinitely.

The only other way I can think of to do this would be to disable the camera movement and have my Jetpack ability directly read the mouse axes and apply a torque. However, I still want to take advantage of the built-in mouse smoothing and aim assist, so I'd rather make use of the existing camera controller. Is this even possible?
 

Attachments

  • Jetpack.cs
    4.1 KB · Views: 13
This is definitely possible. Similar to creating new abilities for the character, you can also create new view types for the camera controller. I'd duplicate the FreeLook ViewType and then make your modifications from there. When the jetpack ability is active you can switch to your new view type.
 
Top