GetObject
From MaratisWiki
(Difference between revisions)
Dahnielson (Talk | contribs) |
Dahnielson (Talk | contribs) m |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{lua-function|getObject|objectName}} | |
− | + | Any object you want to apply an action must be declared with getObject, e.g. if you try to translate an object without declaring it first, nothing will happen. | |
+ | |||
+ | {{lua-function-param|objectName|object name}} | ||
To declare an object, simply put at the top of the script : | To declare an object, simply put at the top of the script : | ||
Line 16: | Line 18: | ||
CustomName = getObject("object") | CustomName = getObject("object") | ||
− | Note : You must do the same for anything you want to apply a script. It includes Camera, Text, Meshes and Sounds. | + | '''Note:''' You must do the same for anything you want to apply a script. It includes Camera, Text, Meshes and Sounds. |
[[Category:Lua scripting]] | [[Category:Lua scripting]] | ||
[[Category:Lua function]] | [[Category:Lua function]] | ||
[[Category:Object]] | [[Category:Object]] |
Latest revision as of 00:13, 9 February 2014
getObject(objectName)
Any object you want to apply an action must be declared with getObject, e.g. if you try to translate an object without declaring it first, nothing will happen.
-
objectName
: object name
To declare an object, simply put at the top of the script :
object = getObject("object")
To declare an object from another scene, include the scene as first argument :
scene2 = getScene("scene2") scene2object = getObject(scene2, "object")
You can also give it a different name :
CustomName = getObject("object")
Note: You must do the same for anything you want to apply a script. It includes Camera, Text, Meshes and Sounds.