ChangeAnimation

From MaratisWiki
(Difference between revisions)
Jump to: navigation, search
m
 
Line 1: Line 1:
 
{{lua-function|changeAnimation|object, animationId}}
 
{{lua-function|changeAnimation|object, animationId}}
  
Play or Change an Animation
+
Play or change an animation. Note that it also apply to looped animations.
+
Note that it also apply to looped animations.
+
  
 
+
{{lua-function-param|object|object to operate on}}
 
+
{{lua-function-param|animationId|animation to change to}}
Basic use :
+
  
 
     object = getObject("object")
 
     object = getObject("object")

Latest revision as of 23:58, 8 February 2014

changeAnimation(object, animationId)

Play or change an animation. Note that it also apply to looped animations.

  • object : object to operate on
  • animationId : animation to change to
   object = getObject("object")
   function onSceneUpdate()
       -- On "W" Key Press
       if isKeyPressed("W")  then
           -- Play Walk Animtion
           changeAnimation(object, "1")
       end
       -- On "W" Key Release
       if onKeyUp("W") then
           -- Change to Pose
           changeAnimation(object, "0")
       end 
   end
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox