What is the best way to fling a player, similar to how the impulse grenade in Fortnite knocks back a player?
I’ve tried adding a BodyForce to the HumanoidRootPart that lasts for 0.2 seconds and this works well except that nothing happens every one out of five times.
Player.Character.UpperTorso.Velocity = Vector3.new(50, 50, 50) * direction
This thread depicts a viable way of sending a player in a direction forcefully, similar to an impulse grenade.
That works well in Studio, but nothing happens in the actual server. I think the client instantly overwrites the given head velocity.
hrp.Velocity = hrp.Velocity + scalar*direction
but the reason it isnt worked for you all the time is because it may not apply enough vertical velocity and so you are fighting the friction of the floor
so alternatively you could do something like
hrp.Velocity = hrp.Velocity + scalar*v3(dir.X,verticalScalar,dir.Y)
hrp.Velocity = hrp.Velocity + multiplier*dir
where multiplier is a v3 of the form:
or you could even do
hrp.Velocity = hrp.Velocity + scalar*dir + baseV
where baseV is a v3 of the form
or any combo of these would work too
also you want to use hrp instead of head/torso bc no reason not to (??) and its more consistent (??) (< someone pls say if this is wrong)
also it works with both r15 and r6
Can’t say it’s wrong, but HumanoidRootPart definitely seems more consistent to me. Not everything has a head, but every character (whether controlled by a player or script) should have a root part.
Still doesn’t work in servers, only in Studio
You need to apply the velocity change on the client that is being pushed back, otherwise that client may override the velocity change the server is trying to do, as the client owns their character’s physics.
For me personally, for the hockey checks in my game, I create a bodyforce object on the client that is being checked (parented to the hrp), and have it apply a force for .3 seconds or so before removing it. This method works even with FE, as the client controls their own character’s physics.
Yep, BodyForce is the way I’m doing it right now.
Have you tried setting Humanoid’s State to Ragdoll or FallingDown and set Humanoid.Sit = true and also PlatformStand?
it might help with what you are doing
also consider changing NetworkOwnership if needed
Let me try setting the Humanoid Sit/Platform stand to true when I get home