Strange Camera Offset on VehicleSeat

Hi all,

I’ve noticed a strange offset on my camera position for a specific car and I am unsure what caused it.

This is how it should look like:

I see that there is nothing wrong with the camera properties in both clips.

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.

Is this caused by the model? How can I fix that?

Thanks in advance!

Somehow you’ve offset your view. Looks like you have a working script. Just a matter of tracking down what you changed.

This is odd as it should be on the 1st view

	{
		module = "ChaseCamera",
		parameters = {
			height = 7,
			distance = 15,
		},
	},

And everything else is working when you switch views and ChaseCamera from the 2nd setting or view works fine.

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.

2 Likes

Yes, I have an invisible part connected to the vehicle through WeldConstraint for speed visual effects

I believe it’s centered and pretty much within the car’s visual range. Whereas the offset in the clip seemed pretty far to the left.

I noticed that when I remove the invisible part, I no longer have this issue.

I wonder if there’s any way to ignore certain parts for the VehicleCamera. I think that’s a better way to formulate my question

1 Like

I do not use ChaseCamera at all. This issue is not caused by scripts

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

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.