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

Equation to make the velocity move you to YOUR torso's right?

Asked by
StoIid 364 Moderation Voter
8 years ago

I am trying to make a dodge type move, and i am having trouble making the torso's velocity go to it's right.

I do not know what math i need to do and nothing seems to work, I tried CFrame, vectors..nothing has worked so far. This is what I have so far.

elseif input.KeyCode == Enum.KeyCode.D then 
            print('pressed D')
            local torso = player.Character.Torso
            local bp = Instance.new('BodyVelocity', torso)
            bp.MaxForce = Vector3.new(5000,5000,5000)
            bp.Velocity =  CFrame.new(20,0,0) * torso.CFrame.lookVector
            wait(.8)
            bp:Destroy()
        end

1 answer

Log in to vote
1
Answered by
CodeNil 30
8 years ago
bp.Velocity =  (Torso.CFrame * CFrame.new(20,0,0)).p
0
omg ur even here o,O buoyantair 123 — 8y
Ad

Answer this question