SetPosition

From MaratisWiki
Revision as of 00:37, 11 April 2012 by Vegas (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox