trying to apply bodyvelocity to make a "charge forward" effect in a 2D environment. it doesn't seem to work; i'm comparing the LowerTorso's Y-orientation -- if it's > 90, it goes one way, and if it's < 90, it goes the other way. can't compare the Vector3 as that's two userdata values. here's what i'm trying, and it's kind of worked before, but it's not working at all now:
local myHumanoid = char:FindFirstChild("Humanoid") local Fist = char.RapierBlade local bv local myTorso = char:FindFirstChild("LowerTorso") local target = myHumanoid.TargetPoint local direction = (target - Fist.Position).unit UIS.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end local keypressed = Input.KeyCode if keypressed == Enum.KeyCode[keyDash] and debounce and debounceDash then debounce = false debounceDash = false print(plr.Name..' has pressed the '..keyDash..' key. Yay!') local loadanimation2 = char.Humanoid:LoadAnimation(animationDash) loadanimation2:Play() if myTorso.Orientation.Y < 90 then bv = Instance.new("BodyVelocity") bv.P = 150000 bv.maxForce = Vector3.new(5000, 5000, 0) bv.velocity = Vector3.new(80, 0, 0) bv.Parent = myTorso myTorso.CFrame = CFrame.new(myTorso.Position, myTorso.Position + direction) wait(0.59) bv:Remove() debounce = true wait (.3) debounceDash = true end elseif myTorso.Orientation.Y > 90 then bv = Instance.new("BodyVelocity") bv.P = 150000 bv.maxForce = Vector3.new(5000, 5000, 0) bv.velocity = Vector3.new(-80, 0, 0) bv.Parent = myTorso myTorso.CFrame = CFrame.new(myTorso.Position, myTorso.Position + direction) wait(0.59) bv:Remove() debounce = true wait (.3) debounceDash = true end end)