> I think you should check if you have added a Solid behavior to your obstacles and make sure Solids are assigned as obstacles in the Pathfinding behavior.
> The random numbers that are generated will determine witch obstacle's solid behavior will be turn from Inactive to Active.
>
> There is something you can do :
> - put obstacles on your stage
> - design different (let's say, 5) possible paths that are determined by a different combinaison of obstacles. Put the corresponding set of obstacles in different families named (for exemple) pathObstacle1, pathObstacle2, pathObstacle3...
> - for every moving object, before path is calculated, select a random family and put it as an obstacle in the Pathfinding behavior
> - calculate path
>
> Should be something like that :
> + System: For each MovingObject
> -> MovingObject: Add Pathfinding obstacle Obstacle(random(1,5))
> -> MovingObject: Find path to (targetx, targety)
>
The problem with making obstacles solid is that then the player can't get past those obstacles - also the walls tilemap (which is solid), when added as an obstacle after creation, doesn't work either and the object paths right through it
Just disable obstacles once path is calculated.
Sequence is :
- Activate random set of obstacle
- regenerate obstacle map
- calculate path
- deactivate set of obstacle
- move along path