aframe-look-at-component
A component for A-Frame to tell an entity to face towards
another entity or position. Uses three.js's
Object3D .lookAt()
The look-at component defines the behavior for an entity to dynamically rotate
or face towards another entity or position. The rotation of the entity will be
updated on every tick. The look-at
component can take either a vec3 position
or a query selector to another entity.
Values
Type | Description |
---|---|
selector | A query selector indicating another entity to track. If the other entity is moving then the look-at component will track the moving entity. |
vec3 | An XYZ coordinate. The entity will face towards a static position. |
Usage
Browser Installation
Install and use by directly including the browser files:
My A-Frame Scene
NPM Installation
Install via NPM:
npm install aframe-look-at-component
Then register and use.
;;