Skip to content

Commit

Permalink
[docs] Fix description of follow component logic (aframevr#5423)
Browse files Browse the repository at this point in the history
Previously, the docs suggested calculating a direction based on the difference between the target position and the follower's direction. However, this would not yield the direction from the follower to the target.

The updated documentation suggests subtracting the follower's position from the target position, which is the correct logic and matches the code following the description.
  • Loading branch information
thepelkus-too authored Dec 29, 2023
1 parent fb08614 commit 69e5d00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/introduction/writing-a-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ scene uptime as `time` and time since the last frame as `timeDelta` into the
far the entity should travel towards the target this frame, given the speed.

To calculate the direction the entity should head in, we subtract the entity's
position vector from the target entity's direction vector. We have access to
position vector from the target entity's position vector. We have access to
the entities' three.js objects via `.object3D`, and from there the position
vector `.position`. We store the direction vector in the `this.directionVec3`
we previously allocated in the `init()` handler.
Expand Down

0 comments on commit 69e5d00

Please sign in to comment.