Skip to main content
InaCentaur
Inspiring
May 6, 2025
Question

How to set entity rotation relative to a player's hand (when grabbed)

So I kept trying this.entity.rotation.set(.... fromEuler()..) in OnGrabStart, but for some reason the rotation is never updated? 

4 replies

SeeingBlue
Honored Contributor
May 6, 2025

It might be because you're trying to rotate an item a player has grabbed? I believe once grabbed, the rotation of an object is determined by either the initial grab rotation or the grab anchors.

 

More documentation on grabbable items: https://developers.meta.com/horizon-worlds/learn/documentation/mhcp-program/community-tutorials/creator-manual#grabbing-and-holding-entities

Upcoming Events : Performance Pro - UI Unleashed - Building Responsive & Performant Interfaces Thursday June 19th 5:00 PM PT - Register June Programming Calendar
InaCentaur
Inspiring
May 6, 2025

I am trying to set rotation in the method called onGrabStart ... 

Do grab anchors prevent setting rotation directly to entity by ts? 
For an arbitrary entity, how does one set grab anchor? 

SeeingBlue
Honored Contributor
May 7, 2025

Yes, grab anchor dictate the grab rotation of an object, so setting that objects rotation on grab would not do anything since that rotation get overwrote by grab itself.

Upcoming Events : Performance Pro - UI Unleashed - Building Responsive & Performant Interfaces Thursday June 19th 5:00 PM PT - Register June Programming Calendar
InaCentaur
Inspiring
May 8, 2025

suppose a sword is held 90 degrees off on one axis, how does one mod the grab rotation?