I noticed that by setting the camera type to “Track”, this issue gets fixed. However, this is not the solution I’m looking for. I know this issue is not caused by the vehicle’s scripts as the camera offset remains when I disable them.
Does there happen to be some Part rigidly connected (aka via Weld, or something similar) that is outside the approximate visual range of the car’s bounding box? I was able to reproduce a similar effect:
My character is seated on the VehicleSeat on the right. The gray Part on the left is connected to the seat via a Weld. This results in the VehicleCamera centering between both of them - which appears to be what’s happening to you for that specific car model.
One option is to switch to using a Seat instead of a VehicleSeat. The default VehicleCamera is not enforced when a character sits in a Seat so if there is no specific reason you’re using a VehicleSeat, this is probably the most straight-forward fix. However, this means losing any other default camera functionality associated with VehicleSeats.
If there’s some reason you want/need to keep using VehicleSeats (or you’re just curious to actually figure out why you’re having this issue), you may need to restructure your vehicles, specifically the Parts that are causing the strange camera offset behavior. One approach might be to replace invisible effect parts with Attachments in a Part or Parts that are within the visual bounding box of the vehicle (The Parts should be withing the visual bounding box of the vehicle; The Attachments are not considered by the algorithm used by the VehicleCamera that determines the vehicle’s bounding box). Another approach would be to attach any parts you want excluded from the VehicleCamera’s bounding box check by non-rigid means. All of these options are considered rigid attachments: Weld, Snap, ManualWeld, Motor, Motor6D, RigidConstraint. You could try using something like a BallSocketConstraint or a HingeConstraint instead.
Finally, (advised only as a last resort) there is an option is to edit the default VehicleCamera ModuleScript. Default PlayerScripts are injected at runtime into StarterPlayer/StarterPlayerScripts, but you can grab these files during play solo and copy them into StarterPlayer/StarterPlayerScripts to prevent them being injected at runtime. To fix the issue you’re having (as far as I can tell) you would only need to change one line in the ModuleScript found at PlayerModule/CameraModule/VehicleCamera:
In the function VehicleCamera:Reset():
--Change this line:
self.assemblyOffset = cameraSubject.CFrame:Inverse()*assemblyPosition -- seat-space offset of the assembly bounding sphere center
--To this instead:
self.assemblyOffset = Vector3.zero