Dash System goes the wrong way

  1. What do you want to achieve? I want to have a dash system where it’s Q to dash and whichever way you walk, you dash to.

  2. What is the issue? Everytime I press Q to dash, the dash direction goes the wrong way, it’s like randomizing the dash direction.

  3. What solutions have you tried so far? I tried asking other devs, they don’t know what’s wrong, I followed the tutorial and it’s all flawless. I also tried changing CFrame values but that doesn’t work.

My local script in starterplayerscripts:

my server script:

The problem: https://drive.google.com/file/d/1eljtkRVLH-Sgrf9YcCF5HOT5q5bUeIt4/view

I tried print debugging, but it doesn’t show any errors:

Any help is appreciated, as I’m pretty knew to coding :slight_smile:

2 Likes

You want to do Multiplyer = Character.HumanoidRootPart.CFrame:ToWorldSpace(Multiplyer) before you apply it, so that instead of applying along the world XYZ, it applies along the player’s XYZ.

2 Likes

sorry, where do put I put it at? I tried replacing the Multiplyer = CFrame.new part, but it doesn’t work. The dash does not work.

1 Like

do you mean something like this?

if DashDirection == “W” then
Multiplyer = Character.HumanoidRootPart.CFrame:ToWorldSpace(-1,-1,20)

why not use lookvector?

try to do p.cframe = c.rootpart.cframe.LookVector * Multiplier (should be a single digit)

wrote it like this:

if DashDirection == “W” then
Multiplyer = CFrame.new(-1, -1, -20)
elseif DashDirection == “A” then
Multiplyer = CFrame.new(-20, -1, -1)
elseif DashDirection == “S” then
Multiplyer = CFrame.new(-1, -1, 20)
elseif DashDirection == “D” then
Multiplyer = CFrame.new(20, -1, -1)
end

	Multiplyer = Character.HumanoidRootPart.CFrame:ToWorldSpace(Multiplyer)

However it does not work…

You can use Humanoid.MoveDirection to determine which way to push the player. Since it is normalized by default, all you have to do to adjust the speed / force of the push is to simply multiply the MoveDirection vector by a number. The higher the number, the stronger the push.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.