[Solved]Pathfinding limited to Layer?

Get help using Construct 2

Post » Mon Jul 18, 2016 9:47 am

Hi all,

I have a question about touch input and pathfinding. I just had a thought about it but unfortunately i'm at work so can't test this out yet or post a capx.


Here's my current problem:

I have pathfinding enabled for a character sprite to move about a map (touch.X & touch.Y). The map is on the bottom layer called "map".

When the sprite moves over another sprite on "map" a sprite button is shown on screen on a layer called "locUI".

When I touch the button on "locUI", it of course registers the pathfinding, executes touch.X & touch.Y and moves the character sprite off towards the damn button.

Here's my question:

When entering in the input for pathfinding, instead of touch.X & touch.Y, is possible to add the layer to that? For instance something like mapLayer.touch.X & mapLayer.touch.Y? So it only registers my pathfinding input on that layer? And it wouldn't register the input on the sprite button because that's on a different layer.

Sorry if it's not clear, I think it's hard to explain without the capx. I'll post it later on tonight when I get home.

Thanks for your time.
Last edited by Grymligast on Mon Jul 18, 2016 7:21 pm, edited 1 time in total.
In development: Avalon Isle
B
12
S
4
G
1
Posts: 44
Reputation: 1,496

Post » Mon Jul 18, 2016 7:21 pm

Worked it out if anyone else is in similar position.

Adding another Touch condition to your UI element, then right click on it and hit Invert so it essentially becomes, Pathfind to Touch.X & Touch.Y but not if you're touching UI element.

Happy dev'ing!
In development: Avalon Isle
B
12
S
4
G
1
Posts: 44
Reputation: 1,496


Return to How do I....?

Who is online

Users browsing this forum: richcoz81, Yahoo [Bot] and 47 guests