A world-fixed object, held in place with a constraint
World Constraint
usesWorld.prefab
from the assets as a parent constraint source.World.prefab
is not in the scene, soWorld Constraint
will always stay at position 0, 0, 0.- The parent constraint on
Container
usesReset Target
as a source, which is used to bringContainer
to your avatar.
Worldconstraint-19.mp4
- Drag & drop the
World Constraint
prefab into the base of your Hierarchy. - Right click and unpack the prefab, then drag & drop it onto your avatar.
- Expand the prefab hierarchy and find
Reset Target
- Move
Reset Target
outside ofWorld Constraint
and place it anywhere in your avatars hierarchy as needed.
Note
When building for Quest, you will have to remove unsupported components and shaders
- Place the objects you want to leave in world space inside
World Constraint
->Container
.- Alternatively you can constrain the objects to
Container
.
- Alternatively you can constrain the objects to
- Disable the
Container
parent constraint component to leave it in world space, and enable it to reset theContainer
toReset Target
.
- By default, the Container and its contents will not scale with your avatar. If you want the Container and its contents to scale with your avatar, add a Scale Constraint to the
Container
object, set your avatar as the source, and activate it. - If your Reset Target is directly under your avatar, it won't properly rotate with you in full body.
Constraints: 3
Constraint Depth: 3
World Constraint
|-Container
| |-Cube
|-Reset Target
World Constraint is available as-is under MIT. For more information see LICENSE.