Detect collision in a walking path

Hi there.

I have a cube, which I can select. When I right click it on the map, he moves to there (Like a RTS game).

I also have another type of cubes, called Obstacles.

Right know, I have the collisions being detected using GhostObjects. When they colide, the movement stops and it’s reset.

I want to implement an algorithm that works this way:

  • Right click on map
  • He analyses the path, and he’s going to colide, he doesnt walk (later on, I want to make him take a path around it).

Can I have any help? I can post here code if needed.

Thanks for help.

You might want to have a look at the A* algorithm or the AI plugin with pathfinding ( AI plugin now with NavMesh pathfinding).