Look at

Overview

The Look at action enables automatic rotation of an object toward a designated target. It supports a wide range of use cases - from aligning individual elements to the viewer, to creating coordinated behaviors across multiple grouped objects. This action allows objects to follow other elements, respond to the viewer’s perspective, or dynamically track movement.

Usage examples

  1. 3D UI in VR: recreate user interfaces using 3D objects instead of Floating UI or Hotspots, which are not supported in WebXR for VR Glasses. Demo

  2. Mechanical simulation: use Look at to simulate components like pistons following each other. Demo

  3. Pointer tracking: rotate an object to face the mouse cursor (works only on desktop devices). Demo

  4. Selection-based targeting: apply the action to a selection of objects. Demo

Parameters

  • Object - specifies which object should rotate

  • Target - defines the target to look at. This can be another object, the camera view, or the pointer (on desktop devices).

  • Billboard - when enabled, the object is aligned perpendicular to the camera view instead of pointing directly at the camera. Useful for creating flat elements that always face the screen. Demo

  • Track axis - determines which local axis of the object should face the target. By default, this is set to the Z axis.

  • Up axis - defines the up direction for the object. Must be different from the track axis. Demo

  • Ease type — controls the animation easing when the object rotates

  • Duration — specifies the time (in seconds) it takes to rotate toward the target

  • Delay — optional delay before the action starts

Combining with Transformation

In some cases, the Look at action can be combined with the Transformation action. Note that Transformation by default copies the target's rotation. To achieve a custom orientation while preserving independent control, rotation can be disabled in the Transformation action using the rotation icon toggle.

Last updated