Make passenger camera in vehicles not jitter

As seen here: Ultimate Driving - Roblox

I should add that there is nothing especially bad/wrong about this game and the passenger cameras in all ROBLOX games with vehicles are this way.

6 Likes

@TwentyTwoPilots, do you at all use custom camera scripts that don’t use BasePart:GetRenderCFrame()?
(As I assume that using GetRenderCFrame is working as it should)

The issue isn’t that the camera isn’t aligned to the vehicle exactly – I imagine it is, and that only worsens the problem. What appears to be happening is the passenger’s idea of where the vehicle is and the true location on the server are conflicting, so it’s really an interpolation issue. The client thinks the vehicle is further ahead or behind than it really is, and then shortly later it finds out its guess was wrong and snaps the vehicle to where it is on the server – this continues over and over which causes the jitter affect.

1 Like

No custom camera scripts. I haven’t a chance to really look into the problem so everything camera-wise is stock.

1 Like

It’s not your fault.

It happens in all ROBLOX games (at least the ones with cars).

1 Like

It looks like what’s actually happening is the camera keeps trying to zoom out to it’s current zoom level but the seat/the other guy’s head/whatever keeps getting in the way and making it pop back.

Normally nothing would happen and the camera would just sit there, but fast-moving object + latency + no physics ownership = jittery object + camera trying to zoom out into it = jittery zoom.

Probably we need some sort of special vehicle camera.

It works fine when you are driving so I assume it has something to do with dphysics.

I’ve seen this a lot in my bus simulator. If you zoom out enough it can sometimes be less annoying :stuck_out_tongue:

Yeah when you’re sitting in a VehicleSeat the camera gets offset and ignores almost everything connected to the VehicleSeat to make it easier to drive. Maybe there should be something similar if it detects that you’re sitting in a Seat that’s connected to a VehicleSeat.

I just don’t use VehicleSeats for player interactions. Everyone who sits in the car including the passenger uses a normal seat. The camera seems to work fine though.

Doesn’t happen in my vehicles. [Sides] Vehicle Simulator - Roblox
It can be prevented by using PrimaryPart:SetNetworkOwner.

1 Like

I think I might know whats happening here, though I’m not sure if this is actually the case. Its hard to explain.

First off, take a look at this video, so that you get a better understanding of GetRenderCFrame:

As you can see, the client locally interpolates physics changes from the server if the user doesn’t have network ownership over them.

So what does this have to do with it you may ask?
Raycasting, thats what.

My theory is that raycasts don’t compensate for GetRenderCFrame, so the PopperCam is hitting something that isn’t actually being drawn there. Perhaps the car is getting ahead of your camera, so its just so happening to hit something in the back of the car that makes your camera act weird.

This is probably a legitimate bug.
I need to find a way to reproduce it properly though

1 Like

UPDATE: Can confirm, this is likely what is happening.

Made a bug report thread for it: