Pathfinding Problem.

Discussion and feedback on Construct 2

Post » Wed Apr 27, 2016 12:11 am


I actually work on my game, a pixel strategy but I just had a problem about the pathfinding for units.
I need a good fluidity but this one takes time to function and i have some solid blocks.

I tried to use a behavior 8 direction to create my own pathfinding but without success...

However, i saw that we could take pathfinding positions with NodeXAT and NodeYAT but i don't know how to use them.

how can I solve my problem ?
Posts: 1
Reputation: 179

Post » Wed Apr 27, 2016 10:52 pm

The expressions NodeXAT and NodeYAT get set by the action 'find path'. They are a list of away points.

To acces that list you first need to know how much waypoints there are. The expression 'Sprite.Pathfinding.NodeCount' gives you that info. Then you have to loop trough the waypoints from 0 to count - 1. And the expression to find the postion of the waypoints will be Sprite.Pathfinding.NodeXAt(loop) and Sprite.Pathfinding.NodeYAt(loop).

Better: ... -waypoints ... e-of-sight
Posts: 2,493
Reputation: 20,950

Return to Construct 2 General

Who is online

Users browsing this forum: Google [Bot] and 15 guests