Question Verifying if an GameObject is reachable

Discussion in 'Developer Support' started by LucasSousa, Feb 29, 2016.

  1. Has any resource from API or by yourself (a method or class) to help verify if a GameObject (like a tree, a door, a rock...) is currently reachable - if the object can be "touched" by the user?

    Thanks in advance for support!
  2. If the object can be touched is not part of the API.
    However, you can call Coordinate#isReachable(), which determines if the player can stand on the given coordinate, which you can use to implement your own method.
    LucasSousa likes this.
  3. Yea, good! So, for example, if I need check if a stove, that is inside a small house blocked by a closed door, "is rechable" can I use that method for check if the nearest coordinate from it is reachable? In this cases we must to take in consideration the coordinator and not the object. I'm right?
  4. What you might want is finding if the surroundings are reachable. There's a surroundingsReachable() method in the GameObject query builder, or you can do getArea().getSurroundingCoordinates() and then find if any of those are reachable. Simply isReachable might not work because it only returns true if you can walk to that coordinate and stand on it.
    LucasSousa likes this.
  5. This is exactly what i was going to say. surroundingsReachable checks if any of the coordinates around the objects area are reachable and reachable itself only checks if you can traverse that coordinate.
    LucasSousa likes this.
  6. I'll have to keep this in mind
  7. So I think your solution will gonna work well for a situation like the my example. Now I'm just waiting for 4 gb ram to run the tests. Thanks for your answers! :)

Share This Page