Dash mechanic with RichAI

Hey guys,

I’ve been thinking on how I could approach the idea of dashing mechanic:
-you control a character in a top-down game
-point and click is the movement of that character
-click a dash button would stop if current move order is being executed and dash towards the mouse poistion
-it should take into account obstacles(moving/static) and if there is a walkable node a certain distance from the character towards the mouse direction
-during the dash the character could pass through said obstacles

So it is quite complex described this way. I was thinking of something like getting the destination position and executing the dash with a stopped RichAI and then turning it back on. Or perhaps increasin the speed of the RichAI to a very high number during the dash and making the obstacles passable(not sure if that would be possible or cheap to execute)

Do you guys have any suggestions or if you have implemented something similar how did you approach the problem?

Hi

I think you should be able to do something like:

  1. Disable the RichAI component
  2. Get a walkable point near the mouse position using AstarPath.active.GetNeares(point, NNConstraint.Default).
  3. Perform a dash animation to that point using your code.
  4. Enable the RichAI component again at the final position.

If you need to, you can use a linecast to figure out how far you can move in a straight line towards the mouse position without passing through obstacles (see NavmeshBase - A* Pathfinding Project).