https://github.com/vrlabs/spring-constraint
A constraint with spring behavior.
https://github.com/vrlabs/spring-constraint
Last synced: 5 months ago
JSON representation
A constraint with spring behavior.
- Host: GitHub
- URL: https://github.com/vrlabs/spring-constraint
- Owner: VRLabs
- License: mit
- Created: 2021-12-21T12:52:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-04T20:41:19.000Z (over 1 year ago)
- Last Synced: 2025-04-05T20:35:12.959Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 12.7 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring Constraint
[](https://github.com/VRLabs/Spring-Constraint/releases/latest)
[](https://github.com/VRLabs/Spring-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 with spring behavior

### ⬇️ [Download Latest Version](https://github.com/VRLabs/Spring-Constraint/releases/latest)
### 📦 [Add to VRChat Creator Companion](https://vrlabs.dev/packages?package=dev.vrlabs.spring-constraint)
---
## How it works
* The constraint is weighted between 3 sources to achieve a spring-like effect.
## Install Guide
https://github.com/VRLabs/Spring-Constraint/assets/76777936/6a5056c7-9f47-4caf-bef0-8eae04f84613
* Drag & drop the ``Spring 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 ``Spring Target``
* Move ``Spring Target`` outside of ``Spring 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 your objects inside ``Spring Constraints`` -> ``Container``.
* Alternatively you can constrain the objects to ``Container``.
* To change the characteristics of the spring, change the position constraint values on the ``Motion`` object:
* Sources > Spring Target (default 1.1) controls the strength of the spring. Higher values make it harder to stretch the spring. Min: 1, Max: 2
* Sources > Motion (default 4) dampens acceleration, the higher the value the slower ``Container`` accelerates.
## Performance stats
```c++
Constraints: 2
Constraint Depth: 2
```
## Hierarchy layout
```html
Spring Constraint
|-Container
| |-Cube
|-Motion
|-Spring Target
```
## Contributors
* [lin](https://github.com/oofdesu)
* [PF_Cactus](https://github.com/brandonvdongen)
## License
Spring Constraint is available as-is under MIT. For more information see [LICENSE](https://github.com/VRLabs/Spring-Constraint/blob/main/LICENSE).
[
](https://vrlabs.dev "VRLabs")
[
](https://discord.vrlabs.dev/ "VRLabs")
[
](https://patreon.vrlabs.dev/ "VRLabs")
[
](https://twitter.com/vrlabsdev "VRLabs")