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

3 replies

Meta Employee
August 22, 2025

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
August 23, 2025

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
September 11, 2025

Hi,

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