readViewPosition
readViewPosition(
source,entity,rewind):ReadonlyVector3|null
Where entity stood as the player’s screen showed it at the moment
rewind names. A flight is read at the tick. An entity the player
controls and the page predicts is read where it stands now. Any other
is read where the stream drew it then, from the sends the room and the
player’s page both keep. In a world with no sends, as a game played
alone, it is read where it stands now. The same on both ends but where
the room’s rewind bounds held the step. Null for one the player’s
screen never showed, and one that teleported or respawned since.
Written in place: read it at once.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
QuerySource |
entity |
Entity |
rewind |
Rewind |
Returns
Section titled “Returns”ReadonlyVector3 | null
Example
Section titled “Example”const at = readViewPosition(step, command.payload.ball, command);