Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Making a Pushback effect?

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?

5 comments

0

Have you tried BodyThrust?

0

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.

0

ahh..

0

Wooohooo random downvote

0

Yay another random downvote.

2 answers

✓ Accepted answer
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

0

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

0

Why did you copy & paste SurVur's code?

0

Downvoted for copying and not using a code block.

This discussion is preserved as it was. New answers, comments, and votes are closed.