Can See Object not working with A* Pathfinding?

mdookie4

New member
Hi Justin,

I set the Can See Object task in editor and set physics 2D to true, and from the scene i can see the angle is correct. However when the target came into view of the angle, I do not see a returned object nor the angle reset to 0 as it mentioned in the script.

Is it because I am using A*Pathfinding hence I cannot use this task?

Thank you,
Vincent

ps: Merry Christmas!
 
Last edited:
I do have polygon collider 2D on the target, does setting trigger or not matter? Or is it because I need a primitive collider?
Thank you!

EDIT: I removed the collider on my seeker gameobject, and it worked! The target still has the collider, but why is this so? hmm... sorry for the holiday post!

EDIT2: This is weird.. it worked for one particular object which only has a transform and a polygon collider 2D, but the seeker cannot detect the other objects with the same layer mask.. if i moved both seeker and target to outside the A* pathfinding grid, the seeker can detect the target...

EDIT3: I understand now, the seeker can detect the target, just that at runtime, its path/view was blocked hence the first 'Can See Object' failed, and it proceed to the 2nd task which is Wander.. however when i change the position of the target during runtime, the seeker will be able to 'see object'.. i followed the tutorials and set BE as attached, and set sequence 'abort type lower priority' but if I don't change the position of the target, even when the seeker is within view of the target without any obstacles in between, it is still not able to 'See Object'...
 

Attachments

  • Screen Shot 2019-01-01 at 4.00.42 PM.png
    Screen Shot 2019-01-01 at 4.00.42 PM.png
    66.2 KB · Views: 17
Last edited:
Top