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 revisionBoth sides next revision
attach_points [2020/09/27 15:22] justinattach_points [2020/09/27 15:31] justin
Line 28: Line 28:
 Once you've set up any necessary attach points for your [[object|objects]] and the models to which they will be attached, you can use the [[Attach Object]] scripting function to trigger an [[object]] to be attached to a target [[entity]] in-game, for example to attach a torch to a wall tile when the player interacts with it. Once you've set up any necessary attach points for your [[object|objects]] and the models to which they will be attached, you can use the [[Attach Object]] scripting function to trigger an [[object]] to be attached to a target [[entity]] in-game, for example to attach a torch to a wall tile when the player interacts with it.
  
 +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")
Line 38: Line 39:
 To detach a previously attached [[object]], you can use the [[Detach Object]] scripting function, for example to remove a book from a table when the player interacts with the table. To detach a previously attached [[object]], you can use the [[Detach Object]] scripting function, for example to remove a book from a table when the player interacts with the table.
  
 +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")
attach_points.txt · Last modified: 2022/05/09 15:06 by justin