Currently the dash angles for specifically my back and side dashes are inaccurate and are offset slightly:
I originally used BodyVelocity before switching to LinearVelocity, both of these have the same issue.
Every part on the Player Model is Massless except for the Torso and HumanoidRootPart.
No parts have “EnableFluidForces” Enabled.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is a snippet of code
local bv = Instance.new("LinearVelocity")
bv.ForceLimitMode = Enum.ForceLimitMode.PerAxis
bv.MaxAxesForce = Vector3.new(100000, 0, 100000)
bv.Attachment0 = character.HumanoidRootPart.RootAttachment
bv.Name = "DashVelocity"
bv.Parent = character.HumanoidRootPart
if directionlock == "forward" then
bv.VectorVelocity = humRootPart.CFrame.lookVector* (45)
elseif directionlock == "left" then
bv.VectorVelocity = humRootPart.CFrame.rightVector* (-45)
elseif directionlock == "right" then
bv.VectorVelocity = humRootPart.CFrame.rightVector* (45)
else
bv.VectorVelocity = humRootPart.CFrame.lookVector* (-45)
end
Experiment using camera CFrame instead of HumanoidRootPart, due to how roblox’s physics and animations work.
Or you can try turning this off, to prevent turning
humanoid.AutoRotate = false
OR
you can cache the dash direction and save it.
and you could also flatten the cframe even more
local rootCFrame = humRootPart.CFrame
local flatCF = CFrame.fromMatrix(
rootCFrame.Position,
Vector3.new(rootCFrame.LookVector.X, 0, rootCFrame.LookVector.Z).Unit,
Vector3.new(rootCFrame.RightVector.X, 0, rootCFrame.RightVector.Z).Unit
)
CFrame.fromMatrix takes 3 vectors
(in this order, lookVector, rightVector and upVector)
or if you want to use camera
local camera = workspace.CurrentCamera
local cameraFlatCF = CFrame.lookAt(
camera.CFrame.Position,
camera.CFrame.Position + Vector3.new(camera.CFrame.LookVector.X, 0, camera.CFrame.LookVector.Z)
)
and final solution that just came in my head, that could be causing it
Tweaked around the with the cameraFlatCF, it works almost perfectly. I just needed to tweak the player model so the animation aligns with the dash direction.
Thanks for the help! I wish you luck on any future development endeavors.