Game Development Community

Yet another Behavior Question

by JD Scogin · in Torque Game Builder · 07/21/2007 (3:34 pm) · 1 replies

I am not sure if I am having trouble reading the documentation or that it is lacking.
Anyway, here is the question.
I want to access the health of an object from the "Takes Damage" behavior.
I want to put that number in a variable from an "On Collision" function.
I have tried %srcObj.health, nothing.
Can't seem to figure it out.
If you know the answer and know where it is in the documentation, please point me in the right directions so I can find this stuff for myself.
Thanks
Jd

#1
07/21/2007 (4:07 pm)
Use:
%behavior = %srcObj.getBehavior("TakesDamageBehavior");
%behavior.health...