Skip to main content

SpawnOffset settings

SpawnOffset adds an item-specific position and rotation adjustment relative to the destination used after Spawn.

Fields​

FieldTypeDescription
Position Offset YfloatDistance added along the destination Transform's local Y axis
Rotation OffsetVector3X, 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 structureSearch target
Normal itemSpawn root
CompSpawnHelperReturn Base Go
HGSpawnHelperHG 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.

  1. SpawnOffset on the Spawn root
  2. For an item using a helper, SpawnOffset on Return Base Go or HG Base
  3. TrayItemManual or TrayItem on the search target for that item structure
  4. No offset

Field layouts from versions earlier than ObonEasy v3.0 are not supported.

See Adjust position and rotation when spawning for setup instructions.