• Opsive has been nominated for TWO Unity Awards: Publisher of the Year and Best Development Tool (Behavior Designer Pro)! Your support means everything, cast your vote here: https://awards.unity.com/vote

Behavior Designer Pro Tactical Pack get target from the sensor

spore9

New member
Hello,

I'm new to Behavior Designer, so I apologize if this is a basic question.

I'm creating a simple Behavior Tree where an agent begins attacking when it detects someone on a certain layer at a certain distance. I've set up the tree using the CanDetectObject condition from the Senses pack, which uses a distance sensor and returns a single GameObject.

The issue I'm facing is that the tactical tasks expect an array of GameObjects, but CanDetectObject returns only a single object.

Would creating a custom task that wraps the detected target in an array and assigns it to a variable be a reasonable solution? Or is there a better or built-in way to handle this?

Best regards,
spore9
 
Would creating a custom task that wraps the detected target in an array and assigns it to a variable be a reasonable solution? Or is there a better or built-in way to handle this?
Yes, that is a good approach. I will also include a task similar to that in the next update :)
 
Back
Top