DinoDefence - dino walks thru tower after adding obstacle code

Just completed the pathfinding chapter (19) up to but not including the challenges. The dino walks straight thru the tower.

I’ve also tested the final project from the download - I get the same thing - it just walks straight thru the tower.

I can see it calculating a route - I get three locations so I get three SKAction moves in pathActions in setDinosaurOnPath - so it’s doing something - but I can see the tower shadow and the dino shadow move thru each other.

Does pathfinding work on the simulator? (My dev cert is just renewed on a different machine so I can’t test on a device until I get back to that machine to grab all the signing bits).


I would like to know whether you have found a solution to this problem.

My code also gives the same result. The dino walks through the tower and pathfinding is not working.

I’ve also tested the downloaded Ch 19 final project and also the Ch 20 starter on both my simulator and iPad2 device and they all give the same result. i.e. the dino does not avoid the tower obstacle.

I would be grateful for any advice you may have learned on this matter.

Increase the bufferRadius ( e.g. from 32 to 64) in let obstacleGraph = GKObstacleGraph(obstacles: [], bufferRadius: 32).

Dino is now seen to be avoiding the tower obstacle as coded.

Yes - that helped. Thanks