Skip to main content
This topic has been closed for replies.

3 replies

Meta Employee
Aug 22, 2025 5:34 PM UTC

Hi! 

The recommended way to get users head position for placing screens is via the AvatarAttachment component.

You can get the local head pose like so: 

// Function to get the pose of the user's head
fun getHeadPose(): Pose {
  val head =
      Query.where { has(AvatarAttachment.id) }
          .filter { isLocal() and by(AvatarAttachment.typeData).isEqualTo("head") }
          .eval()
          .first()
  return head.getComponent<Transform>().transform
}

 

Participant
Aug 23, 2025 8:58 PM UTC

Yes, I have that exact code. But where is the head on the human body exactly? Is it the C1 vertebrae? Center of skull? midpoint between eyes?

Meta Employee
Sep 11, 2025 9:53 PM UTC

Hi,

It is the location of the headset in 3D Space.
For rendering purposes, it is also the midpoint between both eyes.