Player Wrist_attachments
scripts/vscripts/alyxlib/player/wrist_attachments.lua
Global variables
| Name | Value |
|---|---|
WristAttachments |
table |
Methods
Add
Adds a new entity as a wrist attachment.
Parameters
entity
EntityHandle
The entity which will become a wrist attachmenthand(optional)
WristAttachmentHandType
The hand type to attach to initiallylength
number
Physical length of the entity to make sure it will not overlap with other wrist attachmentspriority
number?
Priority for the entity when there are other wrist attacments - lower number is higher priority, cannot specify a value lower than 0offset
Vector?
Optional origin offset for the entity (x component is ignored)angles
QAngle?
Optional angles offset for the entity
SetHand
Sets the hand that the entity should be attached to.
Parameters
entity
EntityHandle
The entity to change data forhand
WristAttachmentHandType
The type of hand to attach tooffset(optional)
Vector
Optional origin offset for the entity (x component is ignored)angles(optional)
QAngle
Optional angles offset for the entity
GetHand
Gets the hand that the entity is attached to.
Parameters
entity
EntityHandle
The entity to get the hand for
Returns
- CPropVRHand?
The hand that the entity is attached to
GetEntityAttachment
Gets the attachment data related to an attach entity.
Parameters
entity
EntityHandle
The entity to get the data for
Returns
- WristAttachmentData?
The attachment data for the entity, or nil if not found
IsEntityAttached
Checks if an entity is attached to a wrist using this system.
Parameters
entity
EntityHandle
The entity to check
Returns
- boolean
true if attached, false otherwise.
Update
Updates the attachments.
This is called automatically when an attachment is added or removed or when the player's primary hand changes.
Types
WristAttachmentData
| Field | Type | Description |
|---|---|---|
| entity | EntityHandle |
|
| hand | WristAttachmentHandType |
|
| length | number |
|
| priority | number |
|
| offset | Vector |
|
| angles | QAngle |
Aliases
WristAttachmentHandType
| Value | Description |
|---|---|
"left" |
|
"right" |
|
"primary" |
|
"secondary" |