pmndrs / ecctrl

🕹️ A floating rigibody character controller
MIT License
465 stars 49 forks source link

How to get player rotation #64

Open campbellgoe opened 1 month ago

campbellgoe commented 1 month ago

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 commented 1 month ago

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

ErdongChen-Andrew commented 1 month ago

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

campbellgoe commented 1 month ago

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

ErdongChen-Andrew commented 1 month ago

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