I’m currently working on a basic car system for a game.
My issue is this: Whenever a new instance of the car is generated, it tends to “jitter”, causing it to move to a offset position. This “jitter” is only corrected after a player has enter the car.
Video Ref:
I haven’t tried much, but I don’t know where to start.
There’s already a specific example which works perfect for you:
local Players = game:GetService("Players")
local vehicleSeat = script.Parent
vehicleSeat.Changed:Connect(function(prop)
if prop == "Occupant" then
local humanoid = vehicleSeat.Occupant
if humanoid then
-- Get the player from the character
local player = Players:GetPlayerFromCharacter(humanoid.Parent)
if player then
vehicleSeat:SetNetworkOwner(player)
end
else
-- Reset ownership when seat is unoccupied
vehicleSeat:SetNetworkOwnershipAuto()
end
end
end)
If it isn’t the network owner maybe check if your vehicle script changes anything.