One of our jobs at Roblox is making sure that developers can create immersive experiences quickly and easily with fully featured, drop-in gameplay systems.
In that vein, we’ve just turned on a change that improves the Roblox vehicle camera. The result is a more fluid, dynamic camera view that gives you a clean shot of the action without inducing motion sickness.
- Camera auto-rotates only when you move the vehicle/start driving
- Improved pitch angle when driving on slopes
- Camera detaches when vehicle spins quickly
- Camera centers on the vehicle
- First person view is handled in a more realistic way, so it feels like you are sitting in the vehicle
Remember how your car camera rotated behind you forcefully, even when you were stopped?
It doesn’t do that now.
AutoCorrection is now gradually engaged as you move forward to help you ease into a good view. It never engages when you’re stopped.
Driving up slopes used to result in a strange pitched view, making it hard to tell where you’re going. The new camera now loosely follows your pitch angle, giving you a better view.
This works for arbitrary gravity vectors, so you can make a wall-riding car game if you so choose.
The old car camera was always centered on your avatar, resulting in an odd offset views in third person.
To fix this, we came up with two rules:
- In third person, the camera is centered on your vehicle’s bounding sphere.
- In first person, the camera is centered on your avatar’s head.
Rotation velocity cutoff
It’s easy to make a camera that can cause motion sickness. If a car hits a wall and spins out, your camera would normally snap around.
This is solved with a rotation velocity cutoff. The camera progressively detaches from the car’s orientation when the car spins fast enough, preventing sharp view changes.
Every game has it’s own unique feel and gameplay style. The new camera exposes a number of variables for you to tune to fit your game.
- Pitch camera stiffness
- Yaw camera stiffness
- Auto correction delay time
- Auto correction min ramped car speed
- Auto correction max ramped car speed
- Auto correction smoothing
- Rotation cutoff min ramped pitch velocity
- Rotation cutoff max ramped pitch velocity
- Rotation cutoff min ramped yaw velocity
- Rotation cutoff max ramped yaw velocity
- Pitch base angle
- First-person camera stiffness multiplier
- Rotation cutoff rising yaw response
- Rotation cutoff falling yaw response
- Rotation cutoff rising pitch response
- Rotation cutoff falling pitch response
- Initial zoom radius, as a fraction of your car’s size
- Third person camera center offset
We’ll be exposing methods to customize these externally without forking the PlayerScripts in the near future.
This is currently available in any game that uses the default Roblox PlayerScripts.
Please let us know if you have feedback or suggestions for future improvements; our team would love to hear it.