BehaviorManager created two

vasepo

New member
i added BehaviorManager into Script Execution Order before default time.

but when runnnig Unity, BehaviorManager is created another when CanSeeObject task executed.

um.
i searched old posts.
you said
the solution is Adding Script Execution Order.

but it didn't work for me.



my situation is.


there are 2 type of External Behavior ( Player, Enemy).
Player , Enemy gameobjects are from prefabs.

when playing game,
bt.EnableBehavior() is called.
and Behavior started.
 
i have macbook pro.
i pulled same sources. and then i played Unity.
BehaviorManager weren't created one more.

sources are same between macbook and desktop.

i got confused.
 
Last edited:
i changed time when calling bt.EnableBehavior() from GameObject.OnEnable() to Some method.
it works fine.
Another BehaviorManager was not created.


i don't know why.

BehaviorManager is snigletone?
 
Glad you got it working. Behavior Manager is a singleton, but if the instance that you add to the scene is registered after your script calls it then it will be created twice. This is why changing the method works - you could have also changed the script execution order for your script to execute after the Behavior Manager is executed.
 
Top