How to rotate a grouped object around the center axis?

Hey everyone, using the forum for the first time now. I wanted to ask if it’s possible to rotate a whole group around one axis. I’ve read some posts about rotating objects around themselves, but the solutions there didn’t work for me.

I’ve tested some similar examples where I rotated a cylindical shape and it worked perfectly fine. It looks like I have issues only when I try to do it with a group (I grouped multiple objects to create a more complex objects).

Here’s my project, the steering wheel is supposed to turn left and right like a real steering wheel would using the arrow keys / a and d.

Thanks in advance!

3 Likes

Hi @Sarge groups can be a bit tricky to work with; As you found the center of the group is not neccesarily the center of all of it’s items visually.
There are 2 options both with their pro’s and cons:

  • Option 1, Bounding box:
    Create a cylinder, scale to steering wheel size and set its opacity to 0; Then add all of the group items into the new cylinder and use this for any movement.

    • Pros: Works well with on click/ collision events as these dont work for groups and now the entire item can be clicked instead of just a part of it.

    • Cons: If you’d want to set the transparentecy of the item you would need to set it for each item individually (which can be done using a simple cound children loop, but you have also grouped sub objects in which case that wont work anymore).

  • Option 2, adjust to match center of group:
    Make an object (like a plane square) and set its height to the same as your object; This represents the group’s center. Then manually drag all of the items inside of the group (but not the group itself) to that centerline.

    • Pros: You can adjust transparentcy for entire group all at once.

    • Cons: Cant have any collision / on click events. Might have to redo the dragging to center if you add objects to the group.

I’ve showcased both options here;

I think your best bet is using the first option as this simplifies things down the line and you’re not removing any possibilities for later coding (transparentcy can technically still be set, rather than not being able to have on click or collision events at all).
Hope to have helped, Good luck with your game!

4 Likes

Thanks a lot for the help! I think I’ll go with the first solution since it looks better, and I don’t think I’ll be needing transparency either way. However, I don’t really get how you got this to work. It looks like you did the same thing as I did. Could you explain this a bit more if you don’t mind?

2 Likes

Click on the “group” and set it’s transparantcy to 100%, you’ll see its just a cylinder object. You can add objects as children to other objects as well as to groups; So I’ve switched your group for an object instead.
Also for the second solution the red plane is purely to see where the center is of the group, you can just delete it and it will still work.

2 Likes

Thank you @Luc for all the help! I see, this looks like a really useful feature since groups don’t allow physics, but this seems to fix that! How do you turn a group into an object though?

1 Like

No problem @Sarge,
Well you don’t really convert it, you just make a new object, then scale it to the appropriate size and drag all of the objects you want to “group” onto the new object in the editor list. (The 3 dots with 3 stripes on the left when editing your cospace).

2 Likes