Behaviors and introspection
by Lance Hampton · in Torque Game Builder · 06/01/2009 (10:50 am) · 3 replies
I'm looking for a way to see what behaviors are currently installed on an object.
My current workaround is to set a variable on the object itself when I add a behavior, but I was wondering if there was a way to do this more directly.
My current workaround is to set a variable on the object itself when I add a behavior, but I was wondering if there was a way to do this more directly.
#2
Thanks.
06/01/2009 (2:52 pm)
Awesome. It is in fact in the behaviorComponent class, which t2dsceneobject is derived from. I hadn't shaken the tree that far up.Thanks.
#3
getBehavior("behaviorName"); // works on any sceneobject
returns that objects instance of the behavior by that name.
06/01/2009 (2:54 pm)
Oh, and it is:getBehavior("behaviorName"); // works on any sceneobject
returns that objects instance of the behavior by that name.
Associate James Ford
Sickhead Games