How do I add obstacle which is the same objec "pathfinding"

Get help using Construct 2

Post » Fri Jan 16, 2015 6:20 pm

How do I add obstacle which is the same objec as "pathfinding" object?
I have 2 the same objects "X" and I want them to avoid object "X".
B
6
Posts: 56
Reputation: 366

Post » Fri Jan 16, 2015 7:59 pm

@NormalOne,

First, I can't help but notice you asked the same question 2 times just 10 minutes apart. Try a little patience. Don't expect immediate answers. Sometimes it takes a little time before someone who knows how to help you sees your question.

Second, as stated in the manual under the pathfinding entry:
"The grid of obstacles is only determined once on startup. If objects are moved in the layout, the pathfinding grid is not updated, and objects will continue to pathfind as if the objects were in their old positions."
https://www.scirra.com/manual/154/pathfinding

In other words, the pathfinding behavior creates a map at the start of the program. This map is then used anytime the behavior is told to find a path.

If you continue reading, it tells you how to update the grid manually but warns against it given the CPU load. If you are constantly trying to recalculate the map every time the object moves you are really going to slow down the system.
"To update the entire obstacle grid use the Regenerate obstacle map action, but note this is a very CPU-intense operation and should only be done on one-off occasions. It is much more efficient to update only small parts of it (ideally only the area that has changed), which can be done with the Regenerate region and Regenerate region around object actions."
B
38
S
12
G
11
Posts: 331
Reputation: 7,712


Return to How do I....?

Who is online

Users browsing this forum: blissfulwizard, DevinMurray and 15 guests