Assembly Linear Velocity on a player (server side)

Hello !

Sorry I didn’t find the answer so far (saw a lot of problem with assemble linear velocity, but nothing for me)

On a server script, I’m able to add a LinearVelocity on a player character and move it this way. But it doesnt replicate for other clients by default.

I was wondering if Assembly Linear Velocity could do it, but I didn’t sucees so far. Is it impossible? Do I have to replicate the LinearVelocity on all the clients ?

Thanks !

1 Like

If you do something to a character on the server, it should replicate to all clients, you’re probably just not doing it correctly.

Do you mean even with LinearVelocity ?

In both cases I set the networkownership of all descendants of the chracter to nil (but that could

local function setNetworkOwner(part)
	if part:IsA("BasePart") then
		part:SetNetworkOwner(nil) -- Set the network owner to the server
	end
end

I hear about assembly ownership, but couldn’t find anything on it.

With LinearVelocity :

local direction = player.Character.HumanoidRootPart.CFrame.lookVector * 50
	local oldSpeed = player.Character.Humanoid.WalkSpeed
	player.Character.Humanoid.WalkSpeed = 0

	local velocity = Instance.new("LinearVelocity")
	velocity.Attachment0 = player.Character.HumanoidRootPart.RootAttachment
	velocity.VectorVelocity = direction
	velocity.ForceLimitsEnabled = false
	velocity.Parent = player.Character.HumanoidRootPart
	
        wait(0.2)
	velocity.VectorVelocity = Vector3.zero
	velocity:Remove()
	player.Character.Humanoid.WalkSpeed = oldSpeed

With AssemblyLinearVelocity :

    local direction = player.Character.HumanoidRootPart.CFrame.lookVector * 50
	local oldSpeed = player.Character.Humanoid.WalkSpeed
	player.Character.Humanoid.WalkSpeed = 0

	print(direction)
	local delay = 0.2
	while delay > 0 do
		
		--player.Character.Humanoid.PlatformStand = true
		player.Character.HumanoidRootPart.AssemblyLinearVelocity = direction * 10
		delay -= 0.01
		wait(0.01)
	end

	player.Character.Humanoid.WalkSpeed = oldSpeed

I won’t keep the code ofc, it’s just for test.

If I remmeber correctly, it’s working fine with the move function, but I can’t use it.

My network ownership isn’t well setup… I don’t know why, but that’s the reason !

Thanks, I’ll keep the tread updated.

Well I was just sending the player object instead of the character…
Showing the network owner can save the day ! Lesson learned thanks ^^

1 Like

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