Object doesn't exist? (eventhough it does)
by Michael K. · in Torque Game Builder · 12/15/2008 (2:54 am) · 1 replies
I define a behaviorfield:
%template.addBehaviorField(image1, "1. Image", object, "", t2dSceneObject);
in my ::onBehaviorAdd(%this)-function i add:
if (isObject(%this.image1)) echo("Exists!");
else echo("Doesn't exist");
then i add the behavior to an object and "point" the image1 behaviorfield to another object... when i run it i recieve a "Doesn't exist" in my console.log
How do i edit values of different objects that are "pointed" to in a behavior?
Wouldn't i - for example - write: %this.image1.visible = false; ?
Thanks!
- Michael
%template.addBehaviorField(image1, "1. Image", object, "", t2dSceneObject);
in my ::onBehaviorAdd(%this)-function i add:
if (isObject(%this.image1)) echo("Exists!");
else echo("Doesn't exist");
then i add the behavior to an object and "point" the image1 behaviorfield to another object... when i run it i recieve a "Doesn't exist" in my console.log
How do i edit values of different objects that are "pointed" to in a behavior?
Wouldn't i - for example - write: %this.image1.visible = false; ?
Thanks!
- Michael
Torque 3D Owner Michael K.
It has to do with the object tree view.
An object can only be found by another object if it is created before the refering object.
But how can i move my object in the object tree to be created before the other object ?
- Michael