
It looks like you're new here. If you want to get involved, click one of these buttons!
Hey everyone. I've made a catapult and I've been struggling with trying to get the entire thing to rotate on the y axis without it falling apart or anything haha. Any ideas would be great!
Answers
Everything should just be under one root gameobject. Rotating that object should do the trick.
Have you perhaps been trying to rotate each individual part?
So this is what I got so far. I having coding that is on the cylinder, which has children linked to it. So, shall I link them all together? And what would be the best way? Thanks
I'd make a new, empty gameobject (ctrl + shift + n) and call it catapult. Then take all the gameobjects you have highlighted in the picture and put them as children of it. Be aware of the position relative to each other. The parent object will be the pivot of the catapult when rotating it. So when you put a child under it, make sure that the parent isn't accidentally somewhere weird.
Then move all your scripts and behaviour to the parent object called catapult. As a rule of thumb, don't put behaviour scripts and meshes on the same object. Often it gives better result to have a parent gameobject with behaviour/scripts and then children objects with graphics. In any case, for a group of objects that stick together like this, there should be one parent object.
Finally, you can make a prefab out of the whole thing, when it has one single parent.
Make a new gameobject, reset its transform, make it the parent of all the catapult parts. Have the movement script sit on the main parent object that you just created.