[Solved]Pathfinding limited to Layer?

0 favourites
  • 2 posts
  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)