I am going to explain my trouble. You will see, I am programming for PSVita (not PSM) and I am making a top view 2d game. My idea is to move my character using the left stick and rotate it using the right one. The traslation is working very well but the rotation is not.
I have tried many ways, every one described in the next post and many others.
My initial code is the following:
MoveRotation(){
float X = Input.GetAxis(“Right Stick Horizontal”); // These give me values between -1 and 1
float Y = Input.GetAxis(“Right Stick Vertical”);
float angle = Mathf.Atan2(X,Y)*Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(new Vector(0,0,angle));
}
void Update(){
MoveRotation();
}
In my debbuging process, when I put debug.log(angle) and I see that the angle is changing when I move the stick but for some reason my character is not rotating. Up to now, I only got to rotate my character using the mouseposition.
Well, if someone can help me I would appreciate it.
Ok, I am closing this post because my initial code is working, the trouble was that I had an aditional code in order to rotate the character using the mouse and this code, for any reason, makes a conflict with the other one. Once I comment it my original code started working.