SetPosition
(Difference between revisions)
(Created page with "Set an object to a given position. Example 1 : This script will move an object to another object. getPosition is used to determinate the first object (the target) position. ...") |
Dahnielson (Talk | contribs) |
||
Line 11: | Line 11: | ||
if isKeyPressed("SPACE") then setPosition(object2, {objectpos[1], objectpos[2], objectpos[3]}) end | if isKeyPressed("SPACE") then setPosition(object2, {objectpos[1], objectpos[2], objectpos[3]}) end | ||
end | end | ||
+ | |||
+ | [[Category:Lua scripting]] |
Revision as of 18:00, 4 February 2014
Set an object to a given position.
Example 1 : This script will move an object to another object. getPosition is used to determinate the first object (the target) position.
object = getObject("object") object2 = getObject("object2") -- Scene update function onSceneUpdate() objectpos = getPosition(object) if isKeyPressed("SPACE") then setPosition(object2, {objectpos[1], objectpos[2], objectpos[3]}) end end