Unity 2D - Rotating the controls themselves
Is there any way to actually rotate the controls in unity 2d? For example when the player rotates upside down, the 'A' and 'D' keys make him walk in the direction he is now facing. To put this into perspective, the player is in space with no gravity and the camera rotates with the player object. I need the controls to rotate with the sprite and the camera. Hope I was able to put this into words clearly, thanks for your time. Here's the code for player rotation with an idea of what I'm looking for:
if (Input.GetKey(KeyCode.E)) {
transform.Rotate(Vector3.forward * -2);
playerCamera.transform.Rotate(Vector3.forward * -2);
//example: Controls.transform.Rotate(Vector3.forward * -2);
}
if (Input.GetKey(KeyCode.Q)) {
transform.Rotate(Vector3.forward * 2);
playerCamera.transform.Rotate(Vector3.forward * 2);
//example: Controls.transform.Rotate(Vector3.forward * 2);
}
Comment