ecctrl icon indicating copy to clipboard operation
ecctrl copied to clipboard

How to get player rotation

Open campbellgoe opened this issue 1 year ago • 4 comments

I can get a ref to the ecctrl to get the player .translation() but is there a way to get rotation too?

I need it to determine the direction of a thrown object from the player.

Thanks.

campbellgoe avatar May 17 '24 15:05 campbellgoe

For First person I guess I could just get the camera rotation.

campbellgoe avatar May 17 '24 15:05 campbellgoe

characterRef.current.rotation() should be the character's rotation.

ErdongChen-Andrew avatar May 18 '24 00:05 ErdongChen-Andrew

@ErdongChen-Andrew that's just giving me 0 0 0 1

campbellgoe avatar May 18 '24 08:05 campbellgoe

Did you turn off the autoBalance? If so, you need to trace the character model .getWorldQuaternion()

ErdongChen-Andrew avatar May 18 '24 19:05 ErdongChen-Andrew