https://github.com/vrlabs/offset-constraint
A hierarchy of animated constraints that display how to move an object in world space while preserving previously generated offsets.
https://github.com/vrlabs/offset-constraint
Last synced: 11 months ago
JSON representation
A hierarchy of animated constraints that display how to move an object in world space while preserving previously generated offsets.
- Host: GitHub
- URL: https://github.com/vrlabs/offset-constraint
- Owner: VRLabs
- License: mit
- Created: 2022-07-27T20:05:50.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-31T22:34:23.000Z (about 1 year ago)
- Last Synced: 2025-06-12T02:07:24.923Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 32.2 MB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Offset Constraint
[](https://github.com/VRLabs/Offset-Constraint/releases/latest)
[](https://github.com/VRLabs/Offset-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 constraint system to preserve offsets

### ⬇️ [Download Latest Version](https://github.com/VRLabs/Offset-Constraint/releases/latest)
### 📦 [Add to VRChat Creator Companion](https://vrlabs.dev/packages?package=dev.vrlabs.offset-constraint)
---
## How it works
* Constraints reference each other as sources and swap their enabled state to preserve offset transforms.
## Install guide
https://github.com/VRLabs/Offset-Constraint/assets/76777936/f20790ad-0a5e-49ee-aaac-3b2e380f5f93
* Merge the Animator Controller ``Offset Constraint FX`` to your own FX Controller, using the [Avatars 3.0 Manager](https://github.com/VRLabs/Avatars-3.0-Manager) tool.
* Drag & drop the ``Offset 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 ``Offset Target``
* Move ``Offset Target`` outside of ``Offset 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 to use inside ``Offset Constraint`` -> ``Container``.
* Alternatively you can constrain the objects to ``Container``.
There are two bools in your FX Controller:
* ``OffsetConstraint/Control``:
* True: Places the ``Container`` in world space and allows the user to set the specified offset.
* False: Constraints the ``Container`` to the ``Offset Target`` with the specified offset.
* ``OffsetConstraint/Reset`` moves the ``Container`` to the ``Offset Target``.
## Performance stats
```c++
Constraints: 2
FX Animator Layers: 1
```
## Hierarchy layout
```html
Offset Constraint
|-Container
| |-Cube
|-Root
| |-End
|-Offset Target
```
## Contributors
* [lin](https://github.com/oofdesu)
## License
Offset Constraint is available as-is under MIT. For more information see [LICENSE](https://github.com/VRLabs/Offset-Constraint/blob/main/LICENSE).
[
](https://vrlabs.dev "VRLabs")
[
](https://discord.vrlabs.dev/ "VRLabs")
[
](https://patreon.vrlabs.dev/ "VRLabs")
[
](https://twitter.com/vrlabsdev "VRLabs")