My current dash mechanic is pretty typical, I simply parent a LinearVelocity\BodyVelocity inside the character’s RootPart when the player presses the dash button. It works pretty well, however I have these issues:
As you can see the character jumps over the terrain whenever there is a slope, which is not really what I’m looking for. So I was wondering if there was a way to make a dash mechanic that follows the terrain slope without making the character jump over it.
In reverse, if the character is trying to walk over a slope, the dash will be much slower and get stuck.
I’ve tried using the Humanoid:MoveTo(vector3)
method, and it works okay-ish but I’m not 100% satisfied because the player can cancel the dash by moving & in order to simulate speed, I have to increase the WalkSpeed of the humanoid, which is something I’d rather avoid doing since it might interfere with my game’s modifiers and such.
I think a possible solution could include raycasting, but not sure on how it could work. Perhaps I project a ray in front of the character, whose lenght matches the distance of the dash, then i project a few extra rays vertically starting from the main ray so I can determine if there is a slope? It can work with the first problem, but not so much with the second.
Thanks to those who can help!