Can hear object still needs to be fixed

MissBig

Member
Changing the movement utility script did nothing. I did that workaround from the other thread but if I close unity and then open it up the target objects have to be readded every single time manually. So why doesn't the layer mask work? That means it doesn't even work in the deathmatch ai kit either. In the deathmatch ai kit it has a check for hearing that checks it against a layer mask then it creates a possible target, this actually doesn't work
 
If your behavior tree is in a prefab or a external behavior tree then you will need to fetch the object at runtime:


The layer mask field should work - I tested it and it correctly populated the internal list.
 
If your behavior tree is in a prefab or a external behavior tree then you will need to fetch the object at runtime:


The layer mask field should work - I tested it and it correctly populated the internal list.
The layer Mask doesn't work otherwise I wouldn't need to populate the target objects list. How can you reference a list at runtime though? I have to use the target objects list for the hear object to work otherwise it doesn't work.
 
The attached sample scene was modified from the Movement Pack scene to show Can Hear Object using the layer mask instead of the target object. If you want to use the Target Objects field then you can populate it using a Shared Variable:

 

Attachments

  • CanHear.unity
    170.2 KB · Views: 5
The attached sample scene was modified from the Movement Pack scene to show Can Hear Object using the layer mask instead of the target object. If you want to use the Target Objects field then you can populate it using a Shared Variable:

I don't understand that demo because the layermask is nothing and the layermask does not work in the deathmatch kit either because I have tested it out. You still have to use the target objects for it to work.
 
In that demo the layer is set to the same object as the marker. It looks like it's set to layer 10. If you don't have an entry in that element you can add a name to it. You could also change the layer to the Water layer for both the behavior tree and the marker. Even without doing anything though you should see the can hear node returning true.
 
Top