:ApplyImpulse doesn't work on the server (for player characters)?

Browsing through the dev forum I noticed that it’s common knowledge that BasePart:ApplyImpulse doesn’t work in the server (for players characters?), but the documentation states:

If the part is owned by a client through automatic ownership, this function can be called from either a client script or a server script

Isn’t player character ownership automatic? Or is it supposed to work on the server?

1 Like

I suggest you use :ApplyImpulse on Client, you will avoid the network ownership bugs, and delays of course.

I’m trying, but it doesn’t seem to work.

I apologize i meant you should use it on Client instead of server.

But you can Set the network owner of the part to nil then set it back after you are done with whatever

2 Likes

have you tried setting the character’s humanoid root part network ownership to server?

1 Like

or using :SetNetworkOwnership(nil) to the part you want apply impulse to

Oh, that makes sense.

Isn’t it supposed to work on the server regardless of network ownership (according to the doc I linked)?

I’m just testing something I don’t want to use remote events for something that I’ll probably erase (so thanks for the network ownership suggestion, I’ll try it out)

The server owns the Anchored parts, but for the unanchored parts the engine automatically sets ownership of that part to the client. the parts that is close to a player’s character are owned by a player.

Exactly.

“this function” being :ApplyImpulse, why wouldn’t it work when calling from the server on a client-owned part (character body part or any other)?

then there might a problem with how you use :ApplyImpulse.

Please read the topics of these answers:

There are a lot of topics about this, nobody can get it working on the server for client-owned parts, even if the ownership was automatically set.

Here’s a repro file I just made in case you want to test it, it’s not just on the forum:

applyImpuseOnServer.rbxl (54.2 KB)

Maybe I’m doing something wrong idk

Alright, I have tested few stuffs, and it works on unanchored parts but not the player’s character, when i took the server code and pasted it on the client code, it worked on the player.

So, what’s different in the character? Its ownership isn’t considered automatic?

You own your character’s ownership by automatic, and there’s a video in the roblox doc that states that.

So either the doc is wrong or the method is fucked up?

Well, i have found something, if you want to apply something on your character, set the network owner of the part to the player:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")

remoteEvent.OnServerEvent:Connect(function(player)
	print("received signal, applying impulse...")

	local rootPart = player.Character.PrimaryPart
	rootPart:SetNetworkOwner(player)
	rootPart:ApplyImpulse(Vector3.new(0, 10000000000 --[[one gazzilion]], 0))
	rootPart:SetNetworkOwnershipAuto()
end)

this works

Whaaaaaaat, on the server? Isn’t the player already the owner of his rootPart?

Idk, i tried this and it made the player fling.

Weird, just tested it, isn’t working for me.