ApplyImpulse with Client Ownership

Hi, I’m trying to launch a projectile from a server-side script, and give the client ownership over the part. The problem is, the ApplyImpulse method doesn’t have any effect. It works when setting the deprecated Velocity property. Removing the client ownership makes it work, although on the wiki it says I can call this method both client and server side for client owned parts.

local function LaunchPart1(part, player)
   part:ApplyImpulse(Vector3.new(50, 0, 0))
   part:SetNetworkOwner(player)
end

local function LaunchPart2(part, player)
   part:SetNetworkOwner(player)
   part:ApplyImpulse(Vector3.new(50, 0, 0))
end

Neither functions work.

1 Like

The Part’s Mass plays a role in this whenever you call the ApplyImpulse function, so presumably what you’d want to do is try & obtain this said “Mass” by using the GetMass() function first, along with adding some sort of BaseForce to multiply with:

local BaseForce = 50

local function LaunchPart(Part, Plr)
    local PartMass = Part:GetMass()

    Part:ApplyImpulse(Vector3.new(PartMass * BassForce, 0, 0))
    Part:SetNetworkOwner(Plr)
end

Thanks for answering, that hasn’t had any affect though.

I noticed this as well, making it pretty useless for applying velocity effects to something owned by a client.

Due to this caveat, I have just been using the old velocity APIs. It will work, however, if you apply the force locally instead.

2 Likes

That’s a shame. I was hoping it wasn’t a bug on ROBLOX’s side. Thank you.

2 Likes

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