Explosion knockback

this is what i use to knock the player away from the explosion

hrp.Velocity = ((hrp.Position - Vector3.new(hitbox.CFrame)).Unit * 60) + Vector3.new(0,5,0)
task.wait(0.2)
hrp.Velocity = Vector3.new(0,0,0)

however it doesnt really work
ive tried bodyvelocity, linearvelocity, :applyimpulse() and they did nothing or did exactly whats in this video

what do i do

2 Likes

Hi! I have 2 suggestions:

Multiply .Unit on bigger value

or use something like this

Humanoid.PlatformStand = true
Root.AssemblyAngularVelocity = Vector3.new(100,0,0)
Root:ApplyImpulse(Vector3.new(0,100,2000))
task.wait(1)
Humanoid.PlatformStand = false

robloxapp-20250202-0144089.wmv (583.1 KB) Video with test
(Yes, i know you used :ApplyImpulse, but i made value higher and added PlatformStand)

hi! so this is my script now

hrp.AssemblyLinearVelocity = -((hrp.Position - Vector3.new(hitbox.CFrame)).Unit * 50)
task.wait(1)
humanoid.PlatformStand = false

it does push the player at a good distance but its always a random direction, and not away from the explosion :pensive:

Here

hrp.AssemblyLinearVelocity = ((hrp.Position - hitbox.Position).Unit * 50)

Why CFrame needed in there?

thank you! it worked.
however there is a half a second delay, is there any way to fix that?


don’t do Vector3.new(cf)
just do cf.Position
I’m amazed that didn’t just simply error.

image
Vector3.new is just built different.

I don’t have any delay on server or client, so i think delay in other piece of your script

Explosion knockback.rbxl (55.0 KB)
^ press G to apply the impulse (client side)

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