+5
Under review

Behavior - Condition - Can see layer or tag

rexdefuror 3 months ago in Behavior updated by Marti (Lead Developer) 3 months ago 2

Summary:

It would be very useful, and make the perception module more versatile if instead of simply using TargetCharacter for Can See condition, there would be a condition to check if the object can see anyone within a tag or layer.

Unity version:
2019.4.1f1
Game Creator version:
1.1.9

Yeah upvoting this. This would be absolutely awesome

+1
Under review

Agree, but this presents some problems. When you try to check if a character can see another one, you just need to check if that other object is seen.

However, checking by layer/tag, means that we'd have to go over ALL game objects on the scene every frame (because instantiating a single object would change the amount of objects to be seen).

This is feasible for simple scenes, but I don't want to assume anything. I have an idea of a new algorithm that space-partitions the scene and allows to look-up for clustered portions of the scene. This would partially solve the problem, but... It's still a very daunting task.

If you want to read more about this algorithm (ALERT! Shamelessly self promoting), you can check it out here (I tried to explain it with very simple words): https://twitter.com/catsoftstudios/status/1201520361201905664

To look for groups of objects there's the Group in Sight, with allows to keep track of multiple characters inside a List Variable, but requires a bit more setup that just asking to look for all objects inside a layer or that have a certain tag.