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

Applying force to torso relative to self?

Asked by 8 years ago

I am trying to make it so that the player can press shift to do a dash/boost. Using Player.Character.Torso.Velocity only makes it relative to the world axis. I tried using BodyThrust.Force, but it isn't a valid member... Any ideas for a work around for Velocity or proper usage of BodyThrust?

0
Make their walkspeed bigger theCJarmy7 1293 — 8y
0
Have you tried using the lookVector of the torso as a unit vector and multiplying that? EgoMoose 802 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

As EgoNoose said, use the lookVector of the torso and multiply it by the speed you want

ex:

local speed = 50
local force = torso.CFrame.lookVector * speed -- force is now relative to where torso is facing
0
Ok thanks! Just for reference of anyone that looks for this problem this is the line I used: Player.Character.Torso.Velocity = Vector3.new(Player.Character.Torso.CFrame.lookVector.X * speed,0,Player.Character.Torso.CFrame.lookVector.Z * speed) DaRtHSpeeDy 10 — 8y
Ad

Answer this question