Skip to content

Example 11:Difference between "this" and "player" in Player.js #2

@Simon1059770342

Description

@Simon1059770342

Hello, Nik! Nice course!
A difficulty has arisen after taking your course and attempting Example 11: What is the difference between "this" and "player" in Player.js?

The relevant code is as follows:
const player = this.object; const pt = this.calculatedPath[0].clone(); pt.y = player.position.y; const quaternion = player.quaternion.clone(); player.lookAt(pt); this.quaternion = player.quaternion.clone(); player.quaternion.copy(quaternion);

Why is it necessary to save "quanternion" to "player.quaternion" in the final line?

Does this imply that "player" stores quaternion in a temporary state after lookAt terget?

THX!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions