I got a small issue where the velocity is causing a fling and knockback when dashing into someone. I do not wanna remove collision normally when using body velocity you can play around with the maxforce but I am not able to find it for AssemblyLinearVelocity. Thank you!
Video example : collision issue and flinging Watch 2024-11-07 22-19-51 | Streamable
dashConnection = RunService.Heartbeat:Connect(function()
local elapsedTime = tick() - startTime
if elapsedTime >= dashDuration then
dashConnection:Disconnect()
dashConnection = nil
humanoidRootPart.AssemblyLinearVelocity = DASH_STOP_VELOCITY
return
end
local easingFactor = easingFunction(elapsedTime / dashDuration)
local dashDirectionVector = getDashDirectionVector()
local targetVelocity = dashDirectionVector * speed * math.max(0.1, (1 - easingFactor))
if dashDirection == "Front" then
if elapsedTime >= 0.15 then
local proximity = canMoveInDashDirection()
if proximity then
currentSlowdownFactor = math.clamp((proximity / RAY_DISTANCE) ^ SLOWDOWN_FACTOR, 0, 1)
else
currentSlowdownFactor = math.min(currentSlowdownFactor + RECOVERY_SPEED_FACTOR, 1)
end
targetVelocity *= currentSlowdownFactor
end
else
if checkCollision(humanoidRootPart, dashDirectionVector) then
targetVelocity *= 0.5
end
end
humanoidRootPart.AssemblyLinearVelocity = Vector3.new(
targetVelocity.X,
humanoidRootPart.AssemblyLinearVelocity.Y,
targetVelocity.Z
)
end)