- Home /
i have a problem roating a group of objects
I am trying to make a car with a mounted gun but, before trying to code the rotation following the mouse (think that i dont know how to do it but that dosent matter) i have to test the rotation of it.
This... car is made only with unity parts.
I can rotate the gun horizontaly with the yellow cilinder but for vertical rotation i am using a game object and rotates like this:
Now i group those parts on the wellow cilinder to allow horizontal rotation and happens this:
Do you know how i can fix this or what i am doing wrong? Thank you all
Answer by mikelortega · Dec 28, 2015 at 12:23 PM
The problem is with the scale. The Yellow cylinder probably has a scale transformation, then when you make the torreta it's child, it gets an scale transform to look good... But then you cannot rotate it.
Try to make the cylinder scale 1,1,1. If that's not posible, create a new game object, make the cylicnder and the torreta it's children and transform independently. This way everything will be easier.
Cualquier duda, pregunta sin miedo ;)
$$anonymous$$il gracias :) Al final toque$$anonymous$$ndo tamaños y metiendo la rotación torreta y sus hijos dentro de deposito ahora el cañon gira bien.
Gira bien hacia arriba (Y) para el cañon:
Y gira bien hacia los lados (X) con el cilindro o el depósito mismo:
$$anonymous$$uchas gracias. Ahora me falta poner físicas al coche y hacer que el cañón se mueva con el ratón. Pero eso ya me ocuparé yo. $$anonymous$$il gracias de muevo :) (uupps.. no se vé el terreno de picos de montaña que puse xd)
$$anonymous$$uy bien, no es exáctamente lo que te proponía, porque las transformaciones de escala en la base te pueden dar problemas con la forma de los hijos. Pero parece que has llegado a una buena solución. Saludos.
Your answer
![](https://koobas.hobune.stream/wayback/20220612053809im_/https://answers.unity.com/themes/thub/images/avi.jpg)