Guides:Constraint dampening: Difference between revisions
m fix image again |
Put image in thumb |
||
| Line 1: | Line 1: | ||
{{Noticebox/Community}} | {{Noticebox/Community}} | ||
[[File:Constraint_dampening_example.gif| | [[File:Constraint_dampening_example.gif|thumb|526x296px|Example effect of dampening]] | ||
Constraint dampening, or self-referencing constraints, allows a constraint to follow its source gradually instead of snapping instantly. It’s most commonly used on avatars, but works in worlds too. The main constraint types are Parent, Position, Rotation, and Scale constraints. Keep weight% of source. 0 (0%) is an instant update to target, 0.2 (20%) - 0.3 (30%) is a good value to smooth out network updates. | Constraint dampening, or self-referencing constraints, allows a constraint to follow its source gradually instead of snapping instantly. It’s most commonly used on avatars, but works in worlds too. The main constraint types are Parent, Position, Rotation, and Scale constraints. Keep weight% of source. 0 (0%) is an instant update to target, 0.2 (20%) - 0.3 (30%) is a good value to smooth out network updates. | ||
The speed toward the target depends on: | The speed toward the target depends on: | ||
* Current distance to the target (larger gap ⇒ faster) | *Current distance to the target (larger gap ⇒ faster) | ||
* Frame rate (more frames per second ⇒ faster) | * Frame rate (more frames per second ⇒ faster) | ||
* Damp weight (lower damp ⇒ faster) | *Damp weight (lower damp ⇒ faster) | ||
== Setup == | == Setup== | ||
=== Manual === | ===Manual=== | ||
[[File:Constraint dampening editor.webp|thumb|Editor setup example]] | [[File:Constraint dampening editor.webp|thumb|Editor setup example]] | ||
| Line 16: | Line 16: | ||
2. Use a second source for the target position | 2. Use a second source for the target position | ||
=== Automated === | ===Automated=== | ||
The [[VRChat Package Manager|VPM package]] from [[Community:VRLabs|VRLabs]] automates this process. After adding it to your hierarchy, unpack the package and move the target object to its desired position. | The [[VRChat Package Manager|VPM package]] from [[Community:VRLabs|VRLabs]] automates this process. After adding it to your hierarchy, unpack the package and move the target object to its desired position. | ||
* [https://github.com/VRLabs/Damping-Constraints/blob/main/README.md Project Page] at github.com | *[https://github.com/VRLabs/Damping-Constraints/blob/main/README.md Project Page] at github.com | ||
==Resources== | ==Resources== | ||
* [https://docs.unity3d.com/Packages/com.unity.animation.rigging@1.3/manual/constraints/DampedTransform.html 'Damped Transform | Animation Rigging'] on ''docs.unity3d.com'' | *[https://docs.unity3d.com/Packages/com.unity.animation.rigging@1.3/manual/constraints/DampedTransform.html 'Damped Transform | Animation Rigging'] on ''docs.unity3d.com'' | ||
[[Category:Guides]] | [[Category:Guides]] | ||
Revision as of 11:04, 30 April 2025

Constraint dampening, or self-referencing constraints, allows a constraint to follow its source gradually instead of snapping instantly. It’s most commonly used on avatars, but works in worlds too. The main constraint types are Parent, Position, Rotation, and Scale constraints. Keep weight% of source. 0 (0%) is an instant update to target, 0.2 (20%) - 0.3 (30%) is a good value to smooth out network updates.
The speed toward the target depends on:
- Current distance to the target (larger gap ⇒ faster)
- Frame rate (more frames per second ⇒ faster)
- Damp weight (lower damp ⇒ faster)
Setup
Manual

1. Add the GameObject with the constraint as one of the sources in the Constraint component, and set its weight to 1. 2. Use a second source for the target position
Automated
The VPM package from VRLabs automates this process. After adding it to your hierarchy, unpack the package and move the target object to its desired position.
- Project Page at github.com
Resources
- 'Damped Transform | Animation Rigging' on docs.unity3d.com