UnassignAvatarFromParticipant
These pages are not yet fully reviewed. The LUIDA team is continuing to review and improve them. If you find anything wrong on these pages, or have questions that aren't resolved by reading them, please ask or report to the LUIDA team.
UnassignAvatarFromParticipant(participantIndex)StableAvatar Management- Fires
- On State Start · During State · On State Exit · Always-on events
Description
Removes all avatar wrapper items currently assigned to the specified participant, restoring their default Cluster avatar. Like AssignAvatarToParticipant, the call is readiness-gated: if the participant isn't yet enrolled, the request is queued and retried until they appear (with a 5-second fallback). A late-arriving unassign supersedes any earlier-queued request for the same participant.
Parameters
| Name | Type | Description |
|---|---|---|
participantIndex | integer (≥ 1) | 1-based participant index. |
Side effects
- Despawns every avatar wrapper item that LUIDA's avatar manager has associated with this participant. If no wrapper was assigned, the call is a safe no-op.
- After the call, the participant's normal Cluster avatar becomes visible again (subject to the experiment's
participantAvatarModeWeb Console setting — see Creating an experiment → World & Platform). - If
participantIndexis out of range and stays out of range for ≥ 5 seconds, AvatarManager logs a warning and drops the queued request. - No state keys are written, no signals fired, and
$.groupStateis untouched.
Example
Pair every AssignAvatarToParticipant with a matching unassign on the symmetric state boundary so participants return to their own avatar cleanly between blocks:
// On State Start of an Intro state
AssignAvatarToParticipant("doctor_coat", 1);
// On State Exit of the same block's End state
UnassignAvatarFromParticipant(1);For a paired study, unassign both participants at the end of the block:
UnassignAvatarFromParticipant(1);
UnassignAvatarFromParticipant(2);A defensive unassign at the very start of the experiment is also a good habit, in case a previous session left state behind that the new session inherits:
// On State Start of the experiment's very first state
UnassignAvatarFromParticipant(1);Related
AssignAvatarToParticipant(avatarID, participantIndex)— the symmetric setup; always pair them.SyncWithParticipantBone(participantIndex, bone, posOffset, rotOffset)— an alternative when you want only a partial body part attachment instead of a full avatar swap.- Tutorial 2 → Priming + Proteus Effect (with LUIDA automation) — the full walkthrough that uses this action defensively on
Introstart and on theEndstate for cleanup. - Cookbook → Unique avatar per participant — recipe-style summary including the defensive-unassign pattern.
- Web Console → Avatars — the avatar inventory that
AssignAvatarToParticipantpulls from.
Source
Assets/Doc/LUIDA-StateListeningItemScriptDoc.md
Original markdown body
- **Description**: Removes **all** avatar wrapper items currently assigned to the specified participant, restoring their default Cluster avatar.
- **Parameters**:
- `participantIndex`: `integer` (starts from 1)