How To Make Directional Dash?

This is something that haven’t been talked about, figured I would make a post about it.

I’ve already made a dash system; however, how can I rotate the HumanoidRootPart when pressing A, S, or D? When not in shift lock, it acts weird. Let me know if there are better methods than rotating.

1 Like

You can use Humanoid.MoveDirection and dash in that direction

2 Likes

How would I achieve this? I’m using LinearVelocity.

local lookVector = Character.PrimaryPart.CFrame.LookVector

local multiplier = 150
local velocity = Vector3.new(lookVector.X, 0, lookVector.Z)*multiplier

Apologies I meant LookVector **

I tried that and it doesn’t seem to work.

LV.VectorVelocity = Vector3.new(Character.PrimaryPart.CFrame.LookVector, 0, Character.PrimaryPart.CFrame.LookVector) * 50

I still think it cooler to change their direction before dashing.

Have you tried using body Orientation

Oh it seems this isn’t what you wanted, that code is to dash in the direction the player is currently heading to. Could you explain what you want exactly? Recenter the camera to where they’re dashing?

Here would be the correct code (if you want to explore this dash system, it might be better):

local lookVector = Character.PrimaryPart.CFrame.LookVector

LV.VectorVelocity = Vector3.new(lookVector.X, 0, lookVector.Z) * 50

Have you played blox fruit or TSB? Basically, let say you side dash or backdash without shiftlock.
image

Your character appear like this ^

So when you dash it’ll move you like this

However I want character to be like in shift lock without having it on, so basically rotate by like 90 so they can dash the other right

No and I don’t really prefer that as it out of date I believe.

I’m not exactly sure how’s it being kept all along, but this is your first step towards it:

Character:SetPrimaryPartCFrame(CFrame.new(Character.PrimaryPart.Position, workspace.CurrentCamera.CFrame.LookVector*100))

use other code for calculating the dash’s direction, the code above will just make the character look where it’s supposed to (for a brief moment)

1 Like

This?

LV.VectorVelocity = Vector3.new(lookVector.X, 0, lookVector.Z) * 50

Still doesn’t seem to work, anyone else can help still?

I’ll see what I can do but I also think I am having a similar problem so once I figure it out i’ll write back with my results

1 Like

provided that you have the player’s dash direction as a lookvector, you can face them using a BodyGyro like so:

local bg = Instance.new("BodyGyro",character.PrimaryPart)
bg.MaxTorque = Vector3.one * 9e9
bg.CFrame = CFrame.new(Vector3.zero,dashDirection)

-- bg.P and bg.D can be adjusted for a different effect
bg.D = 1
bg.P = 3000

I don’t prefer using BodyGyro as it outdated. Any other methods?

Sure, just replace it with an AlignOrientation:

local attachment = Instance.new("Attachment",char.PrimaryPart)
local aligner = Instance.new("AlignOrientation",char.PrimaryPart)
aligner.Attachment0 = attachment
aligner.Mode = Enum.OrientationAlignmentMode.OneAttachment
aligner.RigidityEnabled = true -- for some reason rigidity is still smooth, no idea what's up with that
aligner.CFrame = CFrame.new(Vector3.zero,dashDirection)

LOL FUNNY THING, i saw this yesterday and it was the exact answer to my problem also but I didn’t remember this post, so sorry :sweat_smile:

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