Look-At
Note: This documentation is for the old 0.1.0 version of A-Frame. Check out the documentation for the current 1.5.0 version
The look-at
component defines the behavior for an entity to dynamically face towards another entity or position. The look-at
component can take either a static position or a query selector to another entity.
Example applications might include having a monster stare at the player:
<a-entity id="monster" geometry="primitive: box" material="src: monster.png" |
Or maybe having a dog look at a running squirrel:
<a-entity id="dog" geometry="primitive: box" material="src: dog.png" |
Described in the table below are possible types of values:
Value | Description |
---|---|
position | An XYZ coordinate. The entity will face towards a static position. |
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. |