Hello, I have already asked this question before but worded it wrong. I would like to ask this question again. I made a script where it basically dashes the player to the Right Direction( like right and left ) . It only works in a single axis the rest other axises it just goes backwards or some other direction. I want this so no matter what axis the player is in they will always go to the right. here is my script:
local uis = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local hum = plr.Character.Humanoid
local cac = plr.Character
uis.InputBegan:connect(function(i)
if i.KeyCode == Enum.KeyCode.F then
hum:ChangeState(Enum.HumanoidStateType.Jumping)
cac.HumanoidRootPart.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.rightVector*50
end
end)
thanks, activatesenju

2 comments
Hmm.
cac's the player's character, but was defined afterhum, and line 13 completely disregards thecacvariable...I like to use HumanoidRootPart instead of torso, but that should always move the player to the right, not sure what the problem is