Hi, I have managed to find this problem on other threads but have not as yet found the solution and I think it is something to do with needing to use math functions on the game object’s rotation?
Take Ethan as the game object and he is facing you.
My virtual joystick rotates him back and forth when I use the up/down part of the joystick…all good!
The virtual joystick rotates him left and right when I use the left/right part of the joystick…all good!
But…
If I rotate Ethan so he is facing left and the use the up or down joystick control he tilts left and right not back and forth.
I know this is to do with his transform rotation needing to be updated to reflect the new angle (angle I think?) but don’t know how.
Currently I have this that is not doing what is required:
transform.Rotate( Vertical, Horizontal, 0f );
Hope I have explained right, please ask if you need more info.
Thanks
Thanks, kinda not sure I follow? I tried this earlier and felt so close: transform.Rotate (Vertical, Horizontal, 0, Space.World); but it still goes bonkers. So do you mean I do this: transform.Rotate (Vertical, Horizontal, 0, Space.World); then if the up/down pressed follow with this: transform.rotation *= Quaternion.Euler(new Vector3(Horizontal, Vertical, transform.rotation.z)); ?
– elpuerco63