How can I reference SceneObjects from my script?
I have the following script I'd like to test but replacing objectA and objectB with the names of my objects is returning 'undefined'. Am I trying to get the SceneObject correctly?
// -----JS CODE-----
// @input SceneObject objectA
// @input float collideDistance = 0.25
// @input SceneObject objectB
var objA = script.objectA.getTransform().getWorldPosition();
var objB = script.objectB.getTransform().getWorldPosition();
var distance = Math.abs( objA.distance(objB));
if( distance <= script.collideDistance ) {
print( "COLLIDE!" );
script.objectA.enabled = false;
}
else
{
}
hello Scott , you can input script in sceneobject and write script.getSceneObject();
or you can write //@input SceneObject objA
and got him through var objA = script.objA;
i hope i was can help you
sorry my english bad((