I've been trying to make a block that pushes players back. I tried bodyforce on the player's torso, but its either too weak to move at all or way too strong, and when the player dies their torso flies away which is messy. How can i just create a brief pushback effect that pushes you a few studs?
Making a Pushback effect?
2 answers
db = true
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Torso") then
if db then
db = false
local torso = hit.Parent.Torso
torso.Velocity = (torso.CFrame.lookVector) * -100
wait(2)
db = true
end
end
end)
Brief Explanation:
I am looking for a torso and then I am setting the Velocity of it. The lookVector is a unit vector that will point to where the CFrame of the part is facing. Since I want it to push backwards, I multiplied it by -100 to move it backwards. You many change the -100 to a higher or lower number.
1 comment
Thanks, this helped me a lot.
db = true script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Torso") then if db then db = false local torso = hit.Parent.Torso torso.Velocity = (torso.CFrame.lookVector) * -100 wait(2) db = true end end end)
2 comments
Why did you copy & paste SurVur's code?
Downvoted for copying and not using a code block.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
Have you tried BodyThrust?
BodyThrust will have a similar problem; either the force is too weak or too strong. This is because the amount of friction the character model exerts upon the ground.
ahh..
Wooohooo random downvote
Yay another random downvote.