Trigonometric functions are functions for calculating. Player->getDirectionVector() returns the side to which player is looking. PHP: /** * @return Vector3 */ public function getDirectionVector() : Vector3{ $y = -sin(deg2rad($this->pitch)); $xz = cos(deg2rad($this->pitch)); $x = -$xz * sin(deg2rad($this->yaw)); $z = $xz * cos(deg2rad($this->yaw)); return $this->temporalVector->setComponents($x, $y, $z)->normalize(); }