Adjust position and rotation when spawning
SpawnOffset adds position and rotation offsets to an item when it moves to the player's hand or a Spawn Point. Use it to place items with different sizes, origins, or forward directions naturally at the same destination.
Setup
- Select the root GameObject registered in the
PoolofVRCObjectPool - Add the
SpawnOffsetcomponent - Set
Position Offset Yto the vertical distance from the destination - Set
Rotation Offsetto the X, Y, and Z rotation angles added to the destination - Spawn the item with
SpawnObjectExtand check its position and orientation
For a normal item, add SpawnOffset to the root GameObject registered in VRCObjectPool. For an item using a helper, the Spawn root and the GameObject assigned to Return Base Go or HG Base are searched. A SpawnOffset on any other child GameObject is not used.
Position offset direction
Position Offset Y is applied along the destination Transform's local Y axis, not the world Y axis.
For example, when a Spawn Point is tilted, the item moves upward according to that tilt. A positive value moves it along local up, and a negative value moves it along local down.
With Move Item To Hand, the hand position is used as the destination and there is no reference rotation. The position offset is therefore applied along the world Y axis.
Rotation offset
Rotation Offset is a local rotation specified in X, Y, and Z and added to the destination rotation. It adjusts an item's own forward direction or tilt relative to the Spawn Point orientation.
Conditions for applying offsets
The offset is applied when the item is moved after Spawn by one of the following settings.
Move Item To Handis enabled- A single
Spawn Pointis assigned - A valid destination is selected from multiple
Spawn Points
Position and rotation offsets are not applied when no destination is configured and the item appears at the VRCObjectPool position without moving. They are also not applied on Return.
Using a helper component
Offsets can also be used on an item with HGSpawnHelper or CompSpawnHelper. Add the helper to the root GameObject registered in the Pool. Add SpawnOffset either to that Spawn root or to the GameObject assigned to the helper's HG Base / Return Base Go. The setting on the Spawn root takes priority when both are present.
After the helper's Move Delay, the item moves to the position and rotation including the offset.
Reusing ObonEasy settings
When ObonEasy v3.0 or later is installed, you can use Position Offset Y and Rotation Offset from TrayItem or TrayItemManual during Spawn without adding SpawnOffset.
This integration requires ObonEasy v3.0 or later. Older versions of ObonEasy are not supported. In a project without ObonEasy, no TrayItem component is found and Object Spawn Extension continues to work normally.
The search target for a TrayItem component depends on the item structure.
| Item structure | Search target |
|---|---|
| Normal item without a helper | Spawn root registered in VRCObjectPool |
CompSpawnHelper | GameObject assigned to Return Base Go |
HGSpawnHelper | GameObject assigned to HG Base |
The entire child hierarchy and other Pickups are not searched. Add TrayItem or TrayItemManual to the specified GameObject.
For a normal item, only the Spawn root is searched for SpawnOffset. For an item using a helper, both the Spawn root and Return Base Go or HG Base are searched for SpawnOffset.
For an item using a helper, the priority is as follows.
SpawnOffseton the Spawn rootSpawnOffsetonReturn Base GoorHG BaseTrayItemManualorTrayItemon the same BaseGo
Multiple offsets are not added together.
Test the behavior
- Set a clearly visible positive value in
Position Offset Y - Spawn the item and confirm that it moves along the destination's local up direction
- Tilt the
Spawn Pointand confirm that the position offset direction follows the tilt - Set
Rotation Offsetand confirm that rotation is added relative to the destination orientation - When using ObonEasy integration, remove
SpawnOffsetand confirm that the offset from the TrayItem component is still applied
See SpawnOffset settings for details about each field.