https://github.com/vrlabs/world-constraint
A world-fixed object, held in place with a constraint.
https://github.com/vrlabs/world-constraint
Last synced: about 1 year ago
JSON representation
A world-fixed object, held in place with a constraint.
- Host: GitHub
- URL: https://github.com/vrlabs/world-constraint
- Owner: VRLabs
- License: mit
- Created: 2021-10-08T10:43:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-04T20:40:09.000Z (over 1 year ago)
- Last Synced: 2024-12-04T21:34:23.295Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 25.1 MB
- Stars: 54
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# World Constraint
[](https://github.com/VRLabs/World-Constraint/releases/latest)
[](https://github.com/VRLabs/World-Constraint/blob/main/LICENSE)
[](https://img.shields.io/badge/Quest-Compatible-green?logo=Meta)
[](https://unity.com/releases/editor/whats-new/2022.3.22)
[](https://vrchat.com/home/download)
[](https://discord.vrlabs.dev/)
[](https://patreon.vrlabs.dev/)
A world-fixed object, held in place with a constraint

### ⬇️ [Download Latest Version](https://github.com/VRLabs/World-Constraint/releases/latest)
### 📦 [Add to VRChat Creator Companion](https://vrlabs.dev/packages?package=dev.vrlabs.world-constraint)
---
## How it works
* ``World Constraint`` uses ``World.prefab`` from the assets as a parent constraint source. ``World.prefab`` is not in the scene, so ``World Constraint`` will always stay at position 0, 0, 0.
* The parent constraint on ``Container`` uses ``Reset Target`` as a source, which is used to bring ``Container`` to your avatar.
## Install guide
https://github.com/VRLabs/World-Constraint/assets/76777936/464287a8-c43c-4cf0-bc6b-5ec700a3eb9b
* 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 of ``World 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
## How to use
* Place the objects you want to leave in world space inside ``World Constraint`` -> ``Container``.
* Alternatively you can constrain the objects to ``Container``.
* Disable the ``Container`` parent constraint component to leave it in world space, and enable it to reset the ``Container`` to ``Reset Target``.
## Additional notes
* 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.
## Performance stats
```c++
Constraints: 3
Constraint Depth: 3
```
## Hierarchy layout
```html
World Constraint
|-Container
| |-Cube
|-Reset Target
```
## Contributors
* [lin](https://github.com/oofdesu)
## License
World Constraint is available as-is under MIT. For more information see [LICENSE](https://github.com/VRLabs/World-Constraint/blob/main/LICENSE).
[
](https://vrlabs.dev "VRLabs")
[
](https://discord.vrlabs.dev/ "VRLabs")
[
](https://patreon.vrlabs.dev/ "VRLabs")
[
](https://twitter.com/vrlabsdev "VRLabs")