I cant believe there isn't any help for this

Run a local server with 2 players.

Put the other player on a car.

On your client I want you to change the CFrame of the car that the OTHER player was put on.

Drive around and try to make your client offset the CFrame of the other car by 20 studs

2 Likes

Huh? This makes no sense to me, please make it more clear.

Disclaimer: I am not a professional and my solution may be wrong!

1 Like

Join a game with 2 players.

Have the other player sit on a car seat and drive it around.

On your CLIENT SIDE make the other player’s car position be offset 10 studs forward.

that still doesnt make sense at all, why would u want to offset a whole car on client?

then just change the position on the client instead of on the server, though this will have some issues such as the other player floating for you

Because you want to compensate for lag. THis is for racing games.

Most pings are .1 seconds

you offset by .1 seconds * velocity to predict where the car truly is on your client

Can you do it?

Can you change the position of a car on the client that is being driven?

I have tried and it doesn’t work. Instead the car locks in place

No you cant change the position of the car on the client that is not driving it for a good reason. If you want to move the car on either client change the network owner of it to the player you want to be able to move the car.

can you show the video and script so we can help you further

The server sends the car’s position to the client.
Correct.

Now the client has to offset the car’s position so that it matches the server’s position.
Do you know that there’s lag right?

How do we do that?

SecureFunctions.CartCreated = function(Info)
		local Cart = Info[1]
		local Driver = Info[2]
		local CartPP = Cart.PrimaryPart

		local PostSimObj = MetaGameplayInfo.PostSimObject
		local PrerenderObj = MetaGameplayInfo.PrerenderObject
		local SteppedObj = MetaGameplayInfo.SteppedObject
		local HeartbeatObj = MetaGameplayInfo.HeartbeatObject
		local Offset = Vector3.new(0,10,0)
		local lastvel
		local Orig = Cart:GetPivot()
		local function GetCartProperties()
			Orig = Cart:GetPivot()
		end
		local function ApplyOffset()
			Cart:PivotTo(Orig+ Offset)
			
		end
		PostSimObj:SetFunction(GetCartProperties)
		PrerenderObj:SetFunction(ApplyOffset)
		task.delay(.5, function()
			for i,v in Cart:GetDescendants() do 
				if v:IsA("BasePart") then
					v.Anchored = false
				end
			end
		end)
		
		local function Cleanup()
			print("Cleaning up cart predictor functions for", Cart)
			
		end

		Cart.AncestryChanged:Once(function()
				Cleanup()
			
		end)

		Driver.AncestryChanged:Once(function()
				Cleanup()
			
		end)
	end
	

I have given up.

show video where its locked and frozen

I think this shoul help