Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you add a small burst of force to where the player is facing?

Asked by
xnocs 7
4 years ago

Hello, so basically what I'm trying to do is add a short burst of force to where the player's UpperTorso is facing, I tried to do this on my own but it doesn't accomplish what I'm looking for.

Also a notice I'm using a ragdoll script then applying the force, and the code provided just makes the player spin in a circle on the floor.

Here's my code:

local Thrust = Instance.new("BodyThrust")
Thrust.Force = Vector3.new(0,500,0) + Character.UpperTorso.CFrame.lookVector * 550
Thrust.Location = Vector3.new(0,Character.UpperTorso.Position.Y + 5,0)
Thrust.Parent = Character.UpperTorso

game.Debris:AddItem(Thrust, .3)

If you could clear up what I did wrong as it's really foggy for me because this is my first time really working with this kind of stuff that would be great. Thank you.

0
What are you trying to do with Thrust.Location? fredfishy 833 — 4y
0
I figured location was the final destination, I thought if you set the y value up a bit it will push the player up as well. xnocs 7 — 4y
0
Thrust.Location is where on the object it applied the force, relative to its current poisition and orientation. Get a deck of cards or a cereal box or something and push it from the centre: it moves forward. Push it from the top (which is what you're doing with that Thrust Location) and you push it over. Push it hard enough from the top and it would probably spin. fredfishy 833 — 4y
0
What's more is that it's *relative* to current position. Adding on the current position again just makes you push that cereal box from further and further up. fredfishy 833 — 4y
0
Wow, that example is really helpful, can you mark that as the question answer? Thank you. xnocs 7 — 4y

Answer this question