Reference to the GameObject this component is attached to This is a three.js Object3D with additional GameObject functionality
Unique identifier for this component instance, used for finding and tracking components
Enable Needle's professional-grade adaptive smoothing for rock-solid tracking. Automatically reduces jitter while staying responsive to real movement.
Pro tip: Keep this enabled (default) for production experiences!
OptionalsourceIdentifier for the source asset that created this component. For example, URL to the glTF file this component was loaded from
ReadonlytrackedYour list of markers to track. Add as many as you need!
How it works across platforms:
Needle's smart deployment: Configure all your markers once, and Needle automatically uses the best tracking mode available on each platform. No platform-specific code needed!
Get the original component type name before minification (available if the component is registered in the TypeStore)
Checks if this component is currently active (enabled and part of an active GameObject hierarchy) Components that are inactive won't receive lifecycle method calls
True if the component is enabled and all parent GameObjects are active
Checks if this component has been destroyed
True if the component or its GameObject has been destroyed
Controls whether this component is enabled Disabled components don't receive lifecycle callbacks
Gets the forward direction vector (0,0,-1) of this component's GameObject in world space
The layer value of the GameObject this component is attached to Used for visibility and physics filtering
The name of the GameObject this component is attached to Used for debugging and finding objects
Gets the right direction vector (1,0,0) of this component's GameObject in world space
Shorthand accessor for the current scene from the context
The scene this component belongs to
Indicates whether the GameObject is marked as static Static objects typically don't move and can be optimized by the engine
Check if image tracking is available on this device right now.
Note: On Android Chrome, WebXR Image Tracking is currently behind a flag during the early access period. Needle automatically falls back to other modes when needed, so your experience keeps working!
The tag of the GameObject this component is attached to Used for categorizing objects and efficient lookup
Gets the up direction vector (0,1,0) of this component's GameObject in world space
Gets the rotation of this component's GameObject in world space as a quaternion
Note: This is equivalent to calling this.gameObject.worldQuaternion
Sets the rotation of this component's GameObject in world space using a quaternion
The world rotation quaternion to set
Gets the rotation of this component's GameObject in world space as Euler angles (in degrees)
Note: This is equivalent to calling this.gameObject.worldRotation
Sets the rotation of this component's GameObject in world space using Euler angles (in degrees)
The world rotation vector to set (in degrees)
Add a marker to track - it's that simple! Needle Engine handles all the platform differences automatically.
Tip: Add all your markers upfront. In WebXR mode they all work simultaneously. In QuickLook mode, the first (primary) marker is used.
The marker configuration to add
Set to true to make this the primary marker (for QuickLook fallback)
Destroys this component and removes it from its GameObject After destruction, the component will no longer receive lifecycle callbacks
Dispatches an event to all registered listeners
The event object to dispatch
Always returns false (standard implementation of EventTarget)
OptionalearlyCalled at the beginning of each frame before regular updates. Use for logic that needs to run before standard update callbacks.
OptionallateCalled after all update functions have been called. Use for calculations that depend on other components being updated first.
OptionalonCalled after the scene has been rendered. Use for post-processing or UI updates that should happen after rendering
OptionalonCalled immediately before the scene is rendered.
Current XRFrame if in an XR session, null otherwise
OptionalonCalled when this component's collider begins colliding with another collider.
Information about the collision that occurred
OptionalonCalled when this component's collider stops colliding with another collider.
Information about the collision that ended
OptionalonCalled each frame while this component's collider is colliding with another collider
Information about the ongoing collision
Called when the component is destroyed. Use for cleanup operations like removing event listeners
OptionalonCalled when the context's pause state changes.
Whether the context is currently paused
The previous pause state
OptionalonCalled when a pointer completes a click interaction with this component's GameObject
Data about the pointer event
OptionalonCalled when a pointer button is pressed while over this component's GameObject
Data about the pointer event
OptionalonCalled when a pointer enters this component's GameObject
Data about the pointer event
OptionalonCalled when a pointer exits this component's GameObject
Data about the pointer event
OptionalonCalled when a pointer moves while over this component's GameObject
Data about the pointer event
OptionalonCalled when a pointer button is released while over this component's GameObject
Data about the pointer event
OptionalonCalled when this component's trigger collider is entered by another collider
The collider that entered this trigger
OptionalonCalled when another collider exits this component's trigger collider
The collider that exited this trigger
OptionalonCalled each frame while another collider is inside this component's trigger collider
The collider that is inside this trigger
OptionalonCalled when a field decorated with @validate() is modified.
Optionalprop: stringThe name of the field that was changed
OptionalonXRControllerCalled when an XR controller is connected or when this component becomes active in a session with existing controllers
Event data for the controller that was added
OptionalonXRControllerCalled when an XR controller is disconnected or when this component becomes inactive during a session with controllers
Event data for the controller that was removed
OptionalresolveCalled when this component needs to remap guids after an instantiate operation.
Mapping from old guids to newly generated guids
Set which marker should be primary (first in the list). Useful when deploying to QuickLook mode where one marker is tracked at a time. In full WebXR mode (iOS AppClip, Android), all markers track simultaneously regardless of order.
Note: Needle Engine automatically adapts - in WebXR all markers work, in QuickLook the primary is used.
The marker model to set as primary
Sets the position of this component's GameObject in world space using individual coordinates
X-coordinate in world space
Y-coordinate in world space
Z-coordinate in world space
Sets the rotation of this component's GameObject in world space using quaternion components
X component of the quaternion
Y component of the quaternion
Z component of the quaternion
W component of the quaternion
Sets the rotation of this component's GameObject in world space using individual Euler angles
X-axis rotation
Y-axis rotation
Z-axis rotation
Whether the values are in degrees (true) or radians (false)
OptionalstartCalled once at the beginning of the first frame after the component is enabled. Use for initialization that requires other components to be awake.
Starts a coroutine that can yield to wait for events. Coroutines allow for time-based sequencing of operations without blocking. Coroutines are based on generator functions, a JavaScript language feature.
Generator function to start
Event to register the coroutine for (default: FrameEvent.Update)
The generator function that can be used to stop the coroutine
Stops a coroutine that was previously started with startCoroutine
The routine to be stopped
The frame event the routine was registered with
OptionalsupportsXRDetermines if this component supports a specific XR mode
The XR session mode to check support for
True if the component supports the specified mode
OptionalupdateCalled once per frame during the main update loop. The primary location for frame-based game logic.
Create powerful AR image tracking experiences with just a few lines of code! WebXRImageTracking makes it incredibly easy to detect marker images in the real world and anchor 3D content to them. Needle Engine automatically handles all the complexity across different platforms and fallback modes for you.
What makes Needle Engine special:
Platform Support & Options:
Simple 3-Step Setup:
trackedImagesarray:image: URL to your marker imagewidthInMeters: Physical size of your printed markerobject: The 3D content to displayPro Tips for Best Results:
widthInMetersto your actual physical marker size for accurate positioningimageDoesNotMovefor wall posters or floor markers - significantly improves stabilitysmooth(enabled by default) for professional-looking, jitter-free trackingWebXRImageTracking component in Unity Editor
WebXRImageTracking panel/component in Blender
Example: Getting started - it's this easy!
Example: Track multiple markers (WebXR mode)
Example: Professional setup for static markers
Why developers love Needle's image tracking:
See
Link
https://engine.needle.tools/docs/xr.html#image-tracking - Full Documentation
Link
https://engine.needle.tools/samples/image-tracking - Try Live Demo
Link
https://github.com/immersive-web/marker-tracking/blob/main/explainer.md - WebXR Marker Tracking Specification