GetBehaviorVariable

From MaratisWiki
Revision as of 19:04, 4 February 2014 by Dahnielson (Talk | contribs)
Jump to: navigation, search

getBehaviorVariable(object, behaviorId, "variableName")

  1. Short description
    • object : The object with the active behavior
    • behaviorId : If your behavior is the first on the list, behaviorId will be 0, the second will be 1, etc.
    • variableName : Behavior parameter name

For example, the "Follow" Behavior has 4 parameters : target, delay, offset, local.

For example, you can display the value of a certain parameter :

   object = getObject("object")
   function onSceneUpdate()
      ObjBehav = getBehaviorVariable(object,  0, "delay")
      if isKeyPressed("key") then print(ObjBehav) end -- will print the "delay" value of object behavior
   end
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox