- Home /
Rotation Problem ( X , Y , Z )
I'm doing a 2d platform game, the z axis represents the depth in this game, but I don't need z because as I said the game is 2d. I wanted the character to fire bullets in the game, so I used Quanternion.identity in the instentiate method. The bullets form in the barrel and then move in the z direction. So I easily turned the barrel 90 degrees in the Y axis. But when I turned it 90 degrees, the barrel did not rotate, so the bullets are moving deep when they should move forward, I want the bullets to move on the x-axis.
I can't change from transform. I haven't tried to replace it with code, and I can't angle it with the rotate tool in unity.
Need more information to answer, it largely depends on how you are moving your projectiles, which we don't know unless you show your code.
I can't change from transform. I haven't tried to replace it with code, and I can't angle it with the rotate tool in unity.
Answer by Dan5500 · Jan 19, 2021 at 07:01 PM
You should try locking the z axis in the inspector. It's under the rigidbody if you have one.
EDIT: It's under constraints. If this doesn't work then idk what to say, I'm kinda new here.
Your answer
Follow this Question
Related Questions
How do I make an angle with the X axis, Y axis, and Z axis and not rotate AROUND the axis? 0 Answers
mouse x not working when mouse y in use? 1 Answer
Restrict camera rotation in x and y? 1 Answer
How to make rotation return to starts after key release? #c 1 Answer
Getting cosinus of an angle in degrees 3 Answers