Difference between revisions of "Bot Playground/Events/sit"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:sit}} <onlyinclude>Fires when bot sits on the object</onlyinclude> <syntaxhighlight lang="javascript"> Bot.on("sit", function(event) { ... }); </syntaxhighligh...")
 
Line 8: Line 8:
 
{{API Event Table}}
 
{{API Event Table}}
 
{{API Variable Group|''event'' object properties}}
 
{{API Variable Group|''event'' object properties}}
{{API Variable|sitting|boolean}} true if bot seated on the object, false if it stands
+
{{API Variable|sitting}} [boolean] true if bot seated on the object, false if it stands
 
{{API Variable|object_uuid}} the UUID of the object bot is sitting on. NULL_KEY if bot is standing.
 
{{API Variable|object_uuid}} the UUID of the object bot is sitting on. NULL_KEY if bot is standing.
{{API Variable|position}} object { x, y, z } - the sitting position (offset)
+
{{API Variable|prev_seat}} [object { x, y, z }] - the sitting position (offset)
  
 
{{API Variables Table End}}
 
{{API Variables Table End}}

Revision as of 18:42, 11 July 2016

Fires when bot sits on the object

Bot.on("sit", function(event) { ... });

Reference

This event comes with the following event object:

Variable Required Description
event object properties:
sitting [boolean] true if bot seated on the object, false if it stands
object_uuid the UUID of the object bot is sitting on. NULL_KEY if bot is standing.
prev_seat [object { x, y, z }] - the sitting position (offset)

Example

Bot.on("sit", function(event) { 
  console.log("I'm sitting on the object ", event.object_uuid);
});