User Tools

Site Tools


attach_points

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
attach_points [2020/09/27 15:34] justinattach_points [2022/05/09 15:06] (current) justin
Line 30: Line 30:
 The example below will attach the "sword" [[object]] model's "handle" attach point to the player's "right_hand" attach point. The example below will attach the "sword" [[object]] model's "handle" attach point to the player's "right_hand" attach point.
 <code bauxite> <code bauxite>
-attach_object("sword", player, "handle", "right_hand")+attach_object("sword", player, "handle", "right_hand");
 </code> </code>
  
-Alternately, you can create attach points for the sword and player using the same ID (e.g. "hand") and leave out the function's fourth parameter.+Alternately, you can create attach points for the sword [[object]] and player [[character]] using the same ID (e.g. "hand") and leave out the function's fourth parameter.
 <code bauxite> <code bauxite>
-attach_object("sword", player, "hand")+attach_object("sword", player, "hand");
 </code> </code>
  
Line 42: Line 42:
 The example below will detach the [[object]] currently attached to the player's "right_hand" attach point. The example below will detach the [[object]] currently attached to the player's "right_hand" attach point.
 <code bauxite> <code bauxite>
-detach_object(player, "right_hand")+detach_object(player, "right_hand")
 +</code> 
 + 
 +You can reference the [[object]] that's currently attached to an attach point using the "attachment" property with the desired attach point ID. In the example below, the "glow" [[animation]] will be played for the [[object]] attached to the player's "right_hand" attach point. 
 +<code bauxite> 
 +play_animation(player.attachment["right_hand"], "glow");
 </code> </code>
  
Line 57: Line 62:
  
 <code bauxite> <code bauxite>
-equip_item(player, "right_hand", "ITEM_0001")+equip_item(player, "right_hand", "ITEM_0001");
 </code> </code>
  
Line 63: Line 68:
  
 <code bauxite> <code bauxite>
-unequip_item(player, "right_hand")+unequip_item(player, "right_hand");
 </code> </code>
  
 ~~NOTOC~~ ~~NOTOC~~
attach_points.1601246047.txt.gz · Last modified: 2020/09/27 15:34 by justin