Game Development Community

ok, I've never used the -> or --> syntax, what does it infer?

by Vince Gee · in Torque 3D Professional · 03/05/2012 (6:54 pm) · 2 replies

I'm kinda confused, what does the -> and --> syntax in torquescript mean and is there another syntax to get the same thing?

#1
03/05/2012 (10:58 pm)
The "->" and "-->" operators were added to Torque script for Torque 3D. Its just syntactic sugar for findObjectByInternalName()
Quote:
MySimSet->SomeInternalName is the same as MySimSet.findObjectByInternalName( "SomeInternalName", false ).

MySimSet-->SomeInternalName is the same as MySimSet.findObjectByInternalName( "SomeInternalName", true ).

Using this techinque with internal names is preferable to spamming the global TorqueScript object namespace with all sorts of GUI objects. Instead you only give names to top level GUI elements and use -> or --> to grab children on demand.

Quote:
--> is used when trying to access a child control by it's internal name
%this-->InspectorWindow
// %this is the parent
// InspectorWindow is the child control's internal name