cancel
Showing results for 
Search instead for 
Did you mean: 

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

InaCentaur
Member

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

4 REPLIES 4

SeeingBlue
Mentor

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/crea...

Upcoming Events:
AMA - Oh My GenAI! A Practical Toolkit Tour Tuesday, May 6th 11:00 AM PT - Register
Build-Along - Code Smarter, Not Harder with Your AI Assistant Tuesday, May 20th 11:00 AM PT - Register
May Programming Calendar

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
Mentor

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:
AMA - Oh My GenAI! A Practical Toolkit Tour Tuesday, May 6th 11:00 AM PT - Register
Build-Along - Code Smarter, Not Harder with Your AI Assistant Tuesday, May 20th 11:00 AM PT - Register
May Programming Calendar

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