Simple Behavior Failing

Vaulcul

New member
Hello,

I have a very simple behavior assigned to a GameObject which randomly patrols between 5 points (see below picture)...

The GameObject itself is a spawn point and runs a script to spawn enemies, this script does not call or acknowledge BD and is not part of the behavior tree.

When the spawn script calls the first time and an enemy spawns, the behavior stops and the GameObject ceases the patrol behavior and will not continue to move. I've tried changing the abort type of the sequence to each of the different settings with no luck on getting this issue to resolve itself.

PatrolProblem.png

Any assistance on getting this to work would be greatly appreciated.

Thanks in advance.
 
Since you don't have any conditional tasks the conditional abort is not used. If you are spawning the behavior tree from a prefab then you'll need to set the patrol locations at runtime. See this page for more details:

 
Justin,

Thanks for the reply.

I didn't think I needed a conditional abort... I originally didn't have one, I was just trying everything I could to get this to work.

The documentation that you've pointed out is precisely why none of the GameObjects in this scene are prefabs... They are all raw GameObjects in the scene. I guess I should have mentioned that these were not prefabs.

The GameObjects that spawn from the moving spawn point are also not prefabs, they just get enabled/disabled as needed to get placed back in the pool that the spawner is pulling from.

Anything else I should try?
 
Is the behavior tree itself included in the scene and not spawned or an external tree?
 
Yes, that is correct. The behavior is on a GameObject already in the scene, it does get enabled from a disabled state... But, I would hope that isn't the issue. The GameObject has always started moving once it is enabled, but it's stopping its movement indefinitely once it spawns something.
 
Here is a simple scene that has the patrol task working. Can you tell me how to modify this scene to get the same behavior as you are seeing? This should help me understand what is happening.
 

Attachments

  • Patrol.unitypackage
    4.7 KB · Views: 1
Justin, I emailed you a link of a troubleshooting project showing the issue.
The specific problem is with the GameObject named "EEnemySpawner1"
 
Last edited:
Top