- Home /
Cannot rotate a triangle shape!
Ok a triangle has 3 sides right and I have formed up that triangle using 3 different game objects and each side is colored differently and the three different sides are under 1 parent game object , I will attach a picture for reference now what I want to do is when I hit an up arrow key the green side should rotate and be replaced by red and when I hit down arrow key green side should be replaced with blue but the triangle itself should not change the position.
Answer by Larkman · Jul 21, 2017 at 12:29 PM
Hello @manikiran22 , If i understood right, you want to rotate the line on 3 different degrees(0, 120, 240) without positioning on script. First of all, you should position the parent gameObject to center of triangle.This will act like pivot point for the line. Also You should get the rotation as a degree by eulerAngles, or just rotate it by Transform.Rotate
Hey @Larkman Thanks for responding, I tried the method that you suggested, however, when i try to rotate the Y-axis of the parent object it's not rotating at the origin, in fact, it is moving in a circular axis.
Your answer
Follow this Question
Related Questions
Rotation object Cardboard 0 Answers
Rotate GameObject Issue 1 Answer
When fliping the character the rotation of character's weapon goes backward 0 Answers
using a custom rotation in "Instantiate" 4 Answers