- Home /
Question by
Jackeson · Nov 06, 2021 at 03:21 PM ·
rotationrotation axis
reverse rotation of game object on button press
transform.Rotate(new Vector3(0f, 1f, 0f) * speed * Time.deltaTime);
So the object rotates on the Y axis and when you press the space bar it shoots a bullet. I also want it to reverse direction on the key press.
Comment
Answer by UnityPlum · Nov 07, 2021 at 12:29 AM
You can just say transform.rotation = Quaternion.Euler(-transform.rotation.x, -transform.rotation.y, -transform.rotation.z)'
to rotate a transform.
Your answer
![](https://koobas.hobune.stream/wayback/20220613045043im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Strange rotation pattern. 0 Answers
Control object yaw by two axis 1 Answer
Object Rotating On Z Axis No Matter What 0 Answers
Rotating an object in a specific direction to a specific point 0 Answers
Rotation changing in untouched axis 1 Answer