I am setting the network ownership of my vehicle to the player, however, when I join the game with a second account the vehicles movements do not replicate to my other account. Only once I exit the vehicle and its final position is updated to the server via remote event, does it suddenly appear. How do I fix this?
local _workspace = game:GetService("Workspace")
local up = _workspace.Up
print(player)
up.Body.Anchored = false
seat:SetNetworkOwner(player)
up.Body.Anchored = true
Sure. I also printed the player and it printed my name.
if _workspace.Up.VehicleSeat.Occupant ~= nil then
local humanoid = seat.Occupant
if humanoid then
local player = game:GetService("Players"):GetPlayerFromCharacter(humanoid.Parent)
if player then
print(player)
up.Body.Anchored = false
seat:SetNetworkOwner(player)
up.Body.Anchored = true
print(player)
end
end
Ah, yeah, you’re right. Client2 can see me once I removed the .Anchored = true. Can’t properly fly the vehicle now though lol. Just keeps falling on the ground
Yeah, only the movement of unanchored parts will replicate (so as long as they aren’t welded to any anchored parts), if you need the vehicle to fly use a BodyForce instance.