SpawnOffset settings
SpawnOffset adds an item-specific position and rotation adjustment relative to the destination used after Spawn.
Fields
| Field | Type | Description |
|---|---|---|
| Position Offset Y | float | Distance added along the destination Transform's local Y axis |
| Rotation Offset | Vector3 | X, Y, and Z local rotation angles added to the destination rotation |
Position calculation
The final position is calculated as follows.
destination position + destination local up × Position Offset Y
When moving to the player's hand, world up is used because there is no destination rotation.
Rotation calculation
The final rotation is calculated as follows.
destination rotation × Quaternion.Euler(Rotation Offset)
When moving to the player's hand, only Rotation Offset is used.
Component placement
For a normal item, add SpawnOffset to the root GameObject registered in VRCObjectPool. For an item using a helper, it can also be added to the GameObject assigned to Return Base Go or HG Base.
The entire child hierarchy is not searched. A SpawnOffset on any other child GameObject is not used.
Conditions for applying offsets
The offset is applied when the item is moved to the player's hand, a single Spawn Point, or a destination selected from multiple Spawn Points.
It is not applied when there is no destination or on Return. Items using HGSpawnHelper or CompSpawnHelper are supported.
ObonEasy integration
When TrayItem or TrayItemManual from ObonEasy v3.0 or later is present, its Position Offset Y and Rotation Offset can be used instead of SpawnOffset. ObonEasy is not a required dependency.
The search target depends on the item structure.
| Item structure | Search target |
|---|---|
| Normal item | Spawn root |
CompSpawnHelper | Return Base Go |
HGSpawnHelper | HG Base |
Only the specified GameObject is searched; its child hierarchy is not. For an item using a helper, SpawnOffset is also searched on the same Return Base Go or HG Base used for the TrayItem component.
The priority is as follows.
SpawnOffseton the Spawn root- For an item using a helper,
SpawnOffsetonReturn Base GoorHG Base TrayItemManualorTrayItemon the search target for that item structure- No offset
Field layouts from versions earlier than ObonEasy v3.0 are not supported.
See Adjust position and rotation when spawning for setup instructions.