"Search" not working in 2D?

scroogi

New member
I have a little bee in my game, and I am trying to get him to look for flowers and go to them. Unfortunately, I can't seem to get him to find the flowers! Can you help me figure out what I am doing wrong?

The navmesh and agent are both set up for 2D. The "wander" functionality works fine, it just can't seem to see the flowers.

Here is my setup:
  • Entry node goes straight to "search"
  • Search is looking for the "flower" layer. All my flowers have been changed to the flower layer. Flowers have colliders.

I am using A*, Behavior Designer, and the movement pack. The integration has been downloaded and is working great!

Update:
Looking at the code, it looks like the search function only uses WithinSight, not WithinSight 2D. Does this mean the integration just doesn't have 2D functionality?
 
Okay so after spending a while rewriting the Seek script for 2D, I realized that a much better way to do it is just a wander node with a conditional abort for "can see". I hope this helps anyone who is having issues in 2D!

Side note: looking for answers to issues about 2D on this forum is really a pain because "2D" is too short so it cuts it out of the search. Is there a way to fix that?
 
Oops, I missed this post.

Search does not contain a 2D setting like Can See Object and Within Distance do. It is a good suggestion though so I'll add it. I am glad that you found a workaround - search really is just a combination of wander and can see so you have a good approach.
 
Im so glad I came across this post. I was like "there must be someone with the same issue as me", I had the same conclusion when I saw the Search script.

Currently the Search task has this "Use 2 D Movement" option that does nothing, in fact I can not even find one single reference of that boolean being used at all in the whole project. It's been a year, is this not gonna be updated?
 
The search task requires you to input the colliders ahead of time, rather than having more flexibility like Can See Object or Within Distance. I recommend using those tasks instead as it gives you a lot more flexibility. Search is just a lightweight combination of Wander, Can See Object and Seek.
 
Top