Skip to main content
Version: 3.0.0

Interactions

Object behaviors are components that allow an object to behave in a specific way. These behaviors use the Unity Physics module to make interactions more natural, especially in a VR environment. They have two modes: Normal and Expert (Debug is for developers only). You can activate the Expert Mode by checking the toggle in the right corner of the component you are using; the expert fields will be highlighted in blue, the debug ones in yellow. The expert mode allows you to modify special properties of the component, for a more precise interaction. The green Interactable button makes the component interactable or not.

note

The Interactions components require a Rigidbody and a Collider to work properly.

The following components are documented in this section: WEAVR Object · Interaction Point · Connectable · Executable · Door · Door Lock · Push Button · Switch · Knob · Path Movement · Screwable · Paintable · Brush


Stateful Behaviors​

State

In some interactions like a Door or a Push Button, you will find so-called "States". States identify a certain position/rotation of the GameObject. Taking a Door as an example, we have two states: the OPEN state which represents the position/rotation of the open door, and the CLOSED state which represents the position/rotation of the closed door. For the door to work properly we need to set these two states. In the case of a door or a push button we will only have two states, but in the case of a switch we could have more than 2 states. The state has a Normal and an Expert mode; the green highlighted state is the current one.

PropertyFunction
NameThe state's name ("Closed" in the picture above)
(position/rotation button)Change the object's position/rotation according to the ones saved in this state
(save button)Save the position/rotation of this state
StableIf enabled, the object will hold the position once reached
EventsEnable Unity Events
Reset TimerIf NOT stable, indicates how long it takes for the object to return to the default state
On Enter / Exit Audio ClipAudio Clip
On State Enter / Exit / HoldUnity Events

WEAVR Object​

WEAVR Object

note

The object's mass affects its behavior when grabbed.

The WEAVR Object component enables you to pick up an object. You need to set the object's layer to Grabbable to grab an object.

PropertyFunction
NameObject's name, used to identify the object inside the scene in play mode
Is GrabbableWhether the object can be grabbed or not
MassObject's mass
Grab Options (Enabled by Grabbable option)Easy Grab = Makes objects easier to grab, although the hand animation will be less precise and sometimes may cause object jittering during grabbing operation. Can Collide = The grabbed object will collide with other objects. Move if Kinematic = The grabbed object will move even if it is kinematic.
Break ForceForce needed to lose the object or the grip
Handling TypeHow you should take the object: No Restriction, One hand, right, left, both hands
Hand PosesDefine custom hand poses for your object. View hand in scene. Switch between left/right hand. Radius = hand interaction radius
Interaction PointsInteraction Points related to this object. You can change range and short range of it. View and modify range inside the scene. Select this interaction point inside the scene
Hover ColorThe color to outline the object when hovering it
Keep Children SteadyIf true, the children interactable objects will stitch to this object
Audio SourceAudio Source to be triggered when grabbing the object
On Grab / On ReleaseUnity Events

Interaction Point​

Interaction Point

Point of interaction of the object. It can be attached to the main object or to a child.

PropertyFunction
RangeRange in which you can interact with the object. Edit range with sphere handles inside the scene
Scan TriggersIf true, the trigger colliders will be considered when scanning for objects in range
Only Interactive ObjectsIf true, only interaction objects will be considered in range
Short RangeA smaller range of interaction
Layer MaskSelect the layer of the objects you want to interact with
On Range Enter / ExitUnity Events
On Short Range Enter / ExitUnity Events

Connectable​

Connectable

How To

To set up a Connectable you can either:

  • Use the wizard by drag and drop the GameObject of your choice in the green box.
  • Manually create a Connection Point with Add Point and then setup all its properties.
  • Automatically create a Connection Point with Fix Point with default properties: this point will have a "sibling" connectable that will move accordingly. Furthermore, if the object is in range (its label will be yellow) the 2 objects will start connected.

The Connectable component connects two game objects together. To connect successfully, both objects need to have at least a child with an Interaction Point component on it.

PropertyFunction
Break Force For SocketsThe Force required to break the connection between a socket and a connector. The minimum force will be considered between the two connectables
Break Force for ConnectionThe Force required to break the connection between two connectors. The minimum force will be considered between the two connectables
Ghost MovementIf true, this object can move through other objects to reach its destination
Preview TransparencyIf the preview is enabled, how transparent the previewed object should be
Connection PointsManage the Connection Point (CP) related to this object. Create a new CP by clicking the apposite button and selecting an Interaction Point from the list

Connection Points Structure​

FieldFunction
Interaction PointEach CP has an Interaction Point
TypeWhether this connection point is a connector or a socket
Object ClassComponent tag that connects behaviors. Create a new one by inserting a new name and pressing ENTER key
Valid ClassesSelect the object that can connect to other objects which have a defined Object Class. Add new one by clicking the [+] on the right corner and selecting a class from the list

Remove the CP by clicking the [X] next to the Interaction Point.

CP Options​

Customize how CP interact with another object (the displayed options depend on the CP type [Socket or Connector]).

OptionFunction
AutoConnectInRangeWhen the "Connector" object is released in range, it will automatically reach the "Socket" and connect
AlignAxisWhen the "Connector" object should connect, it will automatically align its axis to "Socket's axis"
ShortRangeForceConnectWhen "Connector" object enters a short range, it forcibly and automatically connects
PreviewConnectionThe "Connector" object will be previewed as connected when in range
LockConnectionOnce connected, the object can be disconnected only through a disconnect command
IsConnectedInRangeWhen in range, the connection is considered valid, even if the "Connector" is still grabbed
AllowGravityWhen "Connector" object is connected, it will become affected by gravity
CanSlideThe "Connector" object can slide along a given axis for a given length
CanRotateThe "Connector" object can rotate around a given axis for given degrees

CP Start Connected At [Connector Option]​

Object from which the Connection Point will start connected.

FieldFunction
ConnectionThe point which coincides with the connection point
Far PointThe point representing the max distance/rotation from the connection point
Lock On Start ConnectedIf true, the movement will be locked once connected at the point

CP Axis [Socket Option]​

This axis is used both for options CanRotate and CanSlide as primary axis (for rotation and movement respectively).

note

The axis is relative to the Interaction Point.

CP Slide Settings [Socket Option — Enabled by CanSlide]​

Define socket's distance and spring force.

FieldFunction
Disconnect On DistanceWhen the Connector reaches the specified point from connection point it can be disconnected

CP Rotation Settings [Socket Option — Enabled by CanRotate]​

Define socket's rotation angle and spring force.

FieldFunction
Disconnect On Angle ReachedWhen the Connector reaches the specified angle from the connection it can be disconnected

CP On Connect/Disconnect​

FieldFunction
Audio ClipAudio On Connect / Disconnect
Unity EventsConnect / Disconnect
Connect / Disconnect CommandCustomize icon and name of the command seen inside WEAVR Player
warning

The connectable may have an unexpected behavior if the rotation limits are set between [356, 359.9] degrees (and multiples of them).


Executable​

Executable

The Executable component triggers generic actions when interacting with the object.

PropertyFunction
Can Execute on TouchTouching the object will execute the event
On ExecuteUnity Event
Execute CommandCustomize icon and name of the command seen inside the Player

Door​

Door

How To

To set up a Door:

  1. Save the Closed state.
  2. Move the Door's GameObject to the Open position, then save the state.

This component allows you to simulate different types of doors like a Hinge Door or a Slide Door. The door type is detected automatically from the two states you save: if the open and closed states differ only by rotation you get a Hinge Door, if they differ only by position you get a Slide Door.

PropertyFunction
Door TypeShows the type detected automatically from the states (Hinge Door or Slide Door)
Open ValueHow much the door is open, from 0 (closed) to 1 (fully open)
Open ThresholdHow far the door must open before it counts as "open"
Use Long Rotation(Hinge doors) If enabled, the door opens the long way around, for example 270° instead of 90°
Closed / Open StateThe two positions of the door: closed and open
Is LockedWhether the door is locked. Works together with the Door Lock components
Door LocksThe Door Lock components linked to this door
Retrieve LocksClick here to find and add all the Door Locks placed on the door's children
Min Locks to OpenHow many locks must be unlocked before the door can open
Drag ResistanceHow hard the door is to move or rotate
Snap Break ForceHow much force is needed to detach the door once it is snapped fully open or fully closed
Ignore Collision in StatesIf enabled, the door ignores collisions with the colliders placed in its states
Force Opening Ignore CollisionLets the door open through other objects during a procedure, ignoring collisions
Animate By ValueIf enabled, the door is opened/closed using an animation instead of physics. Use the Create button to add the animation component, then assign an opening animation clip
Opening Audio ClipSound played while the door opens or closes
Opening Audio ThresholdHow much the door must move before the opening sound is played again
Opening DurationHow long the door takes to open when opened from a procedure
On Fully Opened / On Fully Closed / On Locked Changed / On Open Value ChangedUnity Events triggered when the door is fully opened, fully closed, locked/unlocked, or its open value changes

Door Lock​

The Door Lock component defines the GameObject as a locking element of a door object. It must be on a Door's child active GameObject. It works with: Executable, Connectable, Push Button, Switch, Knob, and Screwable.

Push Button / Switch: The door lock retrieves the state's names (e.g., LOCKED and UNLOCKED) from the Push Button and Switch interaction. When the interaction is in the LOCKED state, the door is locked; otherwise it is UNLOCKED.

Connectable: The door lock retrieves the two states Connected and Disconnected from the Connectable interaction. When the interaction is in the Connected state, the door is unlocked; otherwise it is locked.

Executable: The door lock retrieves the state of the Executable interaction. When the interaction is executed, it locks and unlocks the object.

Screwable: The door lock retrieves the two states Screwed and Unscrewed from the Screwable interaction. When the interaction is in the Screwed position, the door is locked; otherwise it is unlocked.

Knob: The door lock is based on the value of the Knob interaction. When the knob has a value greater than the threshold the door is locked; otherwise it is unlocked.

Door Lock with Push Button​

Door Lock with Push Button

Door Lock with Connectable​

Door Lock with Connectable

Door Lock with Executable​

Door Lock with Executable

Door Lock with Screwable​

Door Lock with Screwable

Door Lock with Knob​

Door Lock with Knob


Push Button​

Push Button

How To

To set up a Push Button:

  1. Save the Default Position.
  2. Move the Push Button's GameObject to the Down position, then save the state.

The Push Button component allows you to press the GameObject like a push button.

PropertyFunction
Push ValueHow much the button is currently pressed, from 0 (up) to 1 (fully down)
Apply Value On StartIf enabled, the button already starts at the Push Value you set when the scene begins
Allow RotationLets the button turn slightly around its axis while it is pressed
Up / Down StateThe two positions of the button: released (Up) and pressed (Down)
Ignore Collision in StatesIf enabled, the button ignores collisions with the colliders placed in its states
Down Exit DurationHow long (in seconds) you must keep the button pressed before it pops back up
Down Exit DistanceOnce pressed, how far the button can still move before it returns to the Up position
Down ThresholdHow far you must push before the button counts as "pressed"
Up ThresholdHow far the button must come back before it counts as "released"
Spring ForceHow strongly the button pushes itself back up
Damper ForceHow much the return movement is slowed down, to avoid bouncing
Instant CommandsIf enabled, the Player Press/Release commands switch the button instantly, without animation
Press / Release CommandChange the icon and name of the Press and Release commands shown in the Player
On Press / On Release / On Push Value Changed / On State ChangedUnity Events triggered when the button is pressed, released, its value changes, or its state changes

Switch​

Switch

How To

To set up a Switch:

  1. Save the Default Position.
  2. Choose the Switch's type.
  3. Add a new state, move the GameObject to the desired position/rotation, save the state.

The Switch component allows you to interact with the GameObject like a switch.

PropertyFunction
TypeThe switch's type: Rotary or Linear
Use Reflex AngleWhether your angle will be >180 degrees (Enabled by Rotary Switch)
Starting StateThe state the switch is in when the scene begins
Distance ThresholdDistance threshold for state transition
Ignore Collision in StatesIf true, the collisions with colliders in the states will be disabled
Drag ResistancePhysical resistance to linear movement or rotation
StatesSwitch States. Click on "Add state" to create a new state. You can enable/disable them or even reorder them

Knob​

Knob

How To

To set up a Knob:

  1. Save the Start Rotation.
  2. Choose the Max Rotation and the Local Axis.

The Knob component allows you to interact with the GameObject like a knob.

PropertyFunction
ClockwiseDirection of rotation
Max RotationMaximum degrees of rotation the knob can perform starting from the initial rotation
Local Rotation AxisLocal rotation axis for the knob
Start RotationInitial rotation of the knob. Use the START button to save the rotation
ValueCurrent normalized rotation value
Rotation DegreesCurrent rotation degrees
Drag ResistancePhysical resistance to rotation
Rotating Audio ClipAudio clip that will play while rotating
On Value ChangedUnity Event
Raise Event On StopThe event will be raised when the knob has stopped rotating and has assumed the new value
Raise Event DelayDelay with which the event is launched after the stop

Path Movement​

The Path Movement component makes an object move along a path (a curve, called a spline). It is useful for objects that must follow a set track — for example a handle sliding along a rail, a lever, or a part that moves along a curved guide. The object can also follow an animation instead of a straight line.

Path Movement component

PropertyFunction
Spline ContainerThe spline (path) the object follows
Normalized ValueThe object's position along the path, from 0 (start) to 1 (end)
Direction ConstraintWhich way the object may move along the path: Both, only Forward, or only Backwards
Animation ClipAn optional animation the object follows along the path
Adapt Spline To AnimationIf enabled, the path is shaped automatically to match the animation
Spline PointsHow many points are used to shape the path when adapting it to the animation
Interpolation FactorHow quickly the object reaches the target value — a higher value makes it move more quickly
State TransitionsThe states placed along the path, each with a start and end point and a progress value, used to react at specific points of the movement
StatesThe positions along the path saved as states
CommandChange the icon and name of the command shown in the Player

Screwable​

The Screwable component allows you to interact with the GameObject like a Screwable. Taking a screw to be tightened with a screwdriver as an example, we can identify 3 components:

  • Screwable Tool — represents the tool, so the screwdriver.
  • Screwable Hole — represents the hole where the screw will be inserted.
  • Screwable Object — represents the screw.

The easiest way to set these up is the Screwable Wizard, which guides you through configuring the tool, the hole and the object step by step:

Screwable Tool​

Screwable Tool

PropertyFunction
Screwing Local AxisRotation axis for screwing relative to the interaction point
Tool ClassScrewable tool class
Valid ClassesClasses of screwables this tool can interact with
Disconnection Break ForceForce needed to break the connection

Screwable Hole​

Screwable Hole

PropertyFunction
Valid Screwable ClassAlign the closest screwable of chosen class
Fix the interaction point position according to unscrewed position of the closest screwable

Screwable Object​

Screwable Object

PropertyFunction
Screwable OptionsTool Needed = The object can only be screwed using a tool. Is Captive = The object is captive; it cannot be disconnected from its hole. Start Connected = When the game starts, the object is connected to the closest hole.
RotationsNumber of 360-degree rotations to screw the object
Screwed ValueNormalized screwing value. If a value is set before connection, the screwable will automatically reach that value on first connection
Screwed PositionScrewable state
Unscrewed PositionScrewable state
Screwable ClassClass of this object
Show Screwing PreviewShow preview prefab when screwing an object
Screwing Preview PrefabThe preview prefab
Disconnection Break ForceForce needed to break connection

Paintable​

The Paintable component marks a mesh so it can be painted at runtime (for example a wall to spray, a part to coat). The paint is stored per object and follows the real 3D shape, so painting one face never bleeds onto another; it works on opaque, transparent and custom-shader meshes, and the object's original material is left untouched (the paint is drawn as an overlay).

note

Mesh painting works in URP and requires the object to have a Mesh Renderer and Mesh Filter. The device must support compute shaders and 3D render textures.

PropertyFunction
ResolutionDetail of the paint: Low, Medium, High or Max. Higher gives sharper paint but uses more memory.
Make All Children PaintableIf enabled, a Paintable is added automatically to every child mesh.
Coverage ThresholdHow much color a spot must have to count as "painted" (0–1). Used by the paint coverage conditions.
Paint VisibilityHow much the paint ignores scene lighting: 0 = fully lit, 1 = shows its true color everywhere (best visibility in shadow).
Lightweight OverlayUses a cheaper drawing mode (recommended on mobile / Quest).
Force TriplanarProjects the paint texture in object space instead of using the mesh UVs (used automatically for meshes without UVs).
Paint MaterialOptional material defining how the paint looks (color, normal, metallic, smoothness). A Brush carrying its own paint material overrides this at runtime.

Brush​

The Brush component is the tool that paints a Paintable. It paints while its paint colliders touch a paintable surface (no Rigidbody required, so any object can be a brush), on particle collision, or as a forward spray cone. Because the painting colliders are an explicit list, a grabbed brush can have a handle that does not paint and a tip that does.

PropertyFunction
Paint ColorThe color applied by the brush.
EraserIf enabled, the brush removes paint instead of adding it.
Paint MaterialOptional material whose base color (and look) is used for the paint.
RadiusFallback size (world units) used for spray/particle painting and when a paint collider is not a simple shape.
StrengthHow much paint is deposited (0–1).
HardnessHow sharp the painted edge is (0–1).
Paint CollidersThe colliders that actually paint. Leave empty to use the collider on this object; use child colliders (e.g. only the brush tip) so a handle collider does not paint.
Is PaintingWhen off, the brush does not paint. Toggle it at runtime (e.g. from a controller trigger) to control painting.
Is SprayPaints along a forward cone (like a spray can) instead of on contact.
Spray Distance / Spray AngleThe reach and the half-angle of the spray cone.
ParticleAn optional particle system used for the spray visuals; the brush can drive its cone, color and emission.
Spray Audio ClipA sound looped while spraying (with smoothed fade in/out).
On Painting / On Painting Changed / On Effective Painting / On Effective Painting ChangedUnity Events fired while the brush is painting and when it actually deposits paint on a surface.
note

The brush's options (color, radius, strength, spray, eraser…) can also be changed during a procedure with the Set Paint Brush action.