I would like to make a dash ability that punches at the end of the animation, similar to Battlegrounds games and their dashing mechanics, currently my dash looks like this:
(Don’t mind the bad sound effects)
The problem is when I try to make it, I end up getting weird collision issues when I run into a wall looking like this:
Now I can’t tell if this is an animation issue or a scripting issue… Initially the way I add velocity to my character was like this
Neither worked to solve the issue as I still kept having weird collision issues, it even still makes me trip even after I set the HumanoidStateType.FallingDown to false and the HumanoidStateType.Ragdoll to false. But honestly that’s a problem for until the collision issue gets solved… What I want to achive is the dash behaving like this similar to JJK Shenanigans:
Notice as well that it drifts to the left / right depending on what direction their facing as if the wall isn’t stopping them, I wanted to try to add a Raycast where it would set the velocity to 0 if they’re close enough to a wall, but then that wouldn’t result in the drifting if that’s the case. Anyone have any advice on what I should do?
I’ve added the part where it’s anchored down below as well as to how the dash script starts if you’re curious as to what that looks like, but unfortunately it just locks the character in place
dashAnimation:GetMarkerReachedSignal("DashBeginEvent"):Connect(function()
local currentDashSpeed = dashSpeed
local dashCastTick = tick()
local dashCastEndTick = dashCastTick + dashTime
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = {character}
local front = workspace:Raycast(humanoidRootPart.Position, humanoidRootPart.CFrame.LookVector*2, params)
humanoidRootPart.Anchored = true
while (tick() <= dashCastEndTick) do
velocity.VectorVelocity = humanoidRootPart.CFrame.lookVector * currentDashSpeed
velocity.Attachment0 = attachment
velocity.RelativeTo = Enum.ActuatorRelativeTo.World
velocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
velocity.ForceLimitMode = Enum.ForceLimitMode.PerAxis
velocity.MaxAxesForce = Vector3.new(math.huge, 0, math.huge)
if (dashCastEndTick - tick()) <= (dashTime / 2) then
currentDashSpeed *= 0.9
print("Current Dash speed: "..currentDashSpeed)
if front then
--currentDashSpeed = 0 (placeholder to whenever I want to try detecting an object in front)
end
end
task.wait()
end
humanoidRootPart.Anchored = false
currentDashSpeed = dashSpeed
end)
I made a dash thing before and had this problemo too, what I did was
Changing the velocity.MaxForce = math.huge to something like 50000
It worked for me, it might work for you