Currently I M Working On 2d Gameam working on a 2D game just like duet game, it is my first game (unityUnity 2D).
when i mWhen I press left key both point are rotatedpoints rotate fine but problem is. But when i m pressI press right point, the points are not rotated?plz help..
So my problem is why do both points are rotated but only in one direction??why??
Code:
public class TouchControll : MonoBehaviour
{
float movespeed = 3;
float angle = 45;
void Update()
{
if (Input.GetKey(KeyCode.LeftArrow)) // when i m press leftarrow both point should be rotate fine
{
transform.Rotate(Vector3.forward * Time.deltaTime * Input.GetAxis("Horizontal") * angle * movespeed);
Debug.Log("moveleft");
}
if (Input.GetKey(KeyCode.RightArrow)) // problem is here when i m press right arrow key both point are not rotated
{
transform.Rotate(Vector3.forward * Time.deltaTime * Input.GetAxis("Vertical") * angle * movespeed);
Debug.Log("moveright");
}
}
}
Output:






