Game Development Community

Calling behavior function from owner

by Steven Hine · in Torque Game Builder · 01/08/2009 (7:15 pm) · 1 replies

Is there away to call a behavior function from the owner of the behavior. Something like this:

function GoblinClass::myFunction(%this)
{
     ControlBehavior::myFunction();
}

#1
01/08/2009 (11:04 pm)
Had no coffee yet, but something like this could be what you want.

function GoblinClass::myFunction(%this)
{
   %behavior  = %this.getBehavior("ControlBehavior");
   if (!isObject(%behavior))
      return; 
        
   %behavior.myFunction();
}