markrrrrrr
New member
I've got a behavior tree that, in its simplest form, is simply a sequence of "Can See Object" and "Move Towards." The object for "Can See" is defined by the Player tag, and "Move Towards" is the Player object. When I press play, the AI's "Can See" shows success and begins the "Move Towards" task. After that task completes (successfully), the "Can See" task is repeated and returns failure even with my Player capsule within the view cone. Moving my player capsule around, out of, and back into the view cone is fruitless: "Can See" is repeated thousands of times and fails each time.
I've tried setting the "Can See" task to find the Player game object directly (instead of by tag), but the result was the same. Adding debug comments to "Can See" code to display returnedObject.Value yield one line that shows "Player (UnityEngine.GameObject)" and thousands that show no target.
Ultimately what I'm trying to produce is a behavior that will pursue its target while the target is within sight and, if the target disappears (around a corner, for example) will go to the spot at which it last saw its target.
Any suggestions?
I've tried setting the "Can See" task to find the Player game object directly (instead of by tag), but the result was the same. Adding debug comments to "Can See" code to display returnedObject.Value yield one line that shows "Player (UnityEngine.GameObject)" and thousands that show no target.
Ultimately what I'm trying to produce is a behavior that will pursue its target while the target is within sight and, if the target disappears (around a corner, for example) will go to the spot at which it last saw its target.
Any suggestions?