Question by
Cybertiger · Feb 14, 2017 at 08:03 PM ·
rotationquaternionalign
Rotate around local Y axis using Joystick Vector3
I have been banging my head around this for a while now but my "rotLookAtTrans" gameObject is always rotating around world axis. So far i have:
float angle = Mathf.Atan2(joystick.currentDir.x, joystick.currentDir.y) * Mathf.Rad2Deg;
rotLookAtTrans.transform.localRotation = Quaternion.Euler(0, angle, 0) * quaternionOffset;
Can anyone help me with this please?
rotationproblem.jpg
(101.1 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612111108im_/https://answers.unity.com/themes/thub/images/avi.jpg)