ClearAttachmentSlot

Method

Clear avatar attachments currently equipped in a specific slot. This does not affect the user's profile avatar, just the attachments that were equipped in this session.

Definition

void ClearAttachmentSlot(SpatialAvatarAttachment.Slot slot)
void ClearAttachmentSlot(SpatialAvatarAttachment.Slot slot)

Parameters

ParameterDescription
SpatialAvatarAttachment.Slot slot

The slot to clear

Examples

public void ToggleSwordEquipped()
{
IAvatar localAvatar = SpatialBridge.actorService.localActor.avatar;

if (localAvatar.IsAttachmentEquipped("SwordAttachment"))
{
localAvatar.ClearAttachmentSlot(SpatialAvatarAttachment.Slot.RightHand);
}
else
{
localAvatar.EquipAttachment(AssetType.EmbeddedAsset, "SwordAttachment");
}
}
public void ToggleSwordEquipped()
{
IAvatar localAvatar = SpatialBridge.actorService.localActor.avatar;

if (localAvatar.IsAttachmentEquipped("SwordAttachment"))
{
localAvatar.ClearAttachmentSlot(SpatialAvatarAttachment.Slot.RightHand);
}
else
{
localAvatar.EquipAttachment(AssetType.EmbeddedAsset, "SwordAttachment");
}
}