5.11
Distance Constraint
3m 18sπ Key Points
Three modes: closer (max distance), further (min distance), exact (fixed distance).
π TutorialAvailable
Summary
The Distance Constraint establishes a specific physical distance relationship between two objects. It can be used to set a maximum, minimum, or exact distance, allowing objects to be dragged or pushed based on these spatial boundaries.
Step by Step
-
00:26
Adding the ConstraintSelect the object you want to constrain (the owner), navigate to the Constraints section in the Inspector, and add a Distance Constraint.
-
00:33
Visual Distance IndicatorObserve the red guide circle that appears; this is a visual aid representing the current distance value.
-
00:45
Adjusting DistanceModify the Distance property in the Inspector to increase or decrease the radius of the constraint zone.
-
00:59
Setting the TargetUse the target selector to choose a second object. The distance indicator will snap to this target's location.
-
01:50
Configuring ModesChoose between three modes to define the behavior:
- Closer: The owner can move within the distance but is blocked from moving further away (maximum limit).
- Further: The owner can move away but is blocked from moving closer than the set distance (minimum limit).
- Exact: The owner is locked to a precise radius around the target, unable to move closer or further.
-
03:04
Practical ApplicationUse these modes to create mechanics like pupils staying inside an eye or objects being tethered to each other.
Notes About Current Rive
- Interactive Physics: The Distance Constraint is ideal for simulating physical boundaries without complex coding, such as keeping a UI handle within its track.
- Guide Visibility: The red circular guide is only an editor aid and will not appear in your final exported Rive file.
- Target Dynamics: When the target moves, the constrained object will be "dragged" or "pushed" to maintain the rules of the selected mode.
π Notes
Markdown supported
0 chars
