So I would like to know how I can make a dash system like this with this system of detecting collisions in front of the player, it kind of gives a soft stop and prevents him from continuing and colliding with the wall, any help is welcome.
The dash looks like to be a HumanoidRootPart tween, with a raycast that is performed on its look vector before starting the tween. Then, if the raycast result is nil or the distance of result position is above the max dash range, the tween go to the max distance, otherwise, if the distance of result position is under the max dash range, the tween go to the result position - 3 studs.
I’m not sure if I understood correctly, could you try to do something similar and attach a video?
I recommend using linear velocity and the humanoid’s movedirection to get the direction the player is moving for the linear velocity to be applied to.
To make it stop on walls, make a hitbox for the player which appears only when dashing. Use GetPartsInPart function in a runservice loop to see if the player’s hitbox touched a wall, if it did then remove or disable the linear velocity. To filter the character and only target the walls, tag each wall or put your map inside a folder in workspace, and filter each descendant.
make it create a raycast that has the same distance of the dash to the direction the humanoidrootpart is moving, then check if the raycast is colliding with something. if colliding then dash until the raycast hit position, if not then dash normally.
I have already tried both options and I did not get the same result as in the video.
did you add an offset? in the raycast method that i said, for example, you need to add an offset that is a bit before the position the ray hits the wall, so the character doesnt actually hit the wall
If sending a raycast in the dash direction doesn’t work then create a part around the player and once it is hit and the player is dashing then destroy the velocity you can add some other validations for your specific needs