SetRotation

From MaratisWiki
Revision as of 01:19, 9 February 2014 by Dahnielson (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

setRotation(object, vector)

Set an object to a given rotation.

  • object : object to operate on
  • vector : vector

Example 1: This script will set the same rotation of another object getRotation is used to determinate the first object (the target) position.

   object = getObject("object") 
   object2 = getObject("object2")
   -- Scene update
   function onSceneUpdate()
       rotation = getRotation(object)
       if isKeyPressed("SPACE") then setPosition(object2, {rotation[1], rotation[2], rotation[3]}) end
   end
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox