Skip to main content
Participant
March 23, 2025
Question

Rotate objects using codeblocks

Hey everyone! I know how to rotate a single object using codeblocks, but I need a little help. I am looking to rotate one object around another. How do I do that? I’ve tried spin in local space and son relative to an object but it didn’t work. Was I using it wrong? Any help is appreciated! Thanks in advance! 

3 replies

Kayrrie
Inspiring
March 24, 2025

The 2nd object needs to be grouped with a longer invisible object so that it has a different axis so it can go around the 1st object. (I think that’s how it’s described). I was going to write it all down here for u but it’s a lot of words. Give me a little bit and I’ll make a tutorial of how I would do it. 

Participant
March 24, 2025

Okay, cool! Let me know when you get it done so I can check it out. Thank you! 

Kayrrie
Inspiring
March 26, 2025

I don’t see where I can add the clip I did. 
You have to create a new center point with an invisible cube and have the object you want spinning around the other object grouped to it. Make sure that center point of that invisible cube is aligned with the center of the 1st object. Then attach your rotating script to the 2nd grouped objects and it’ll rotate around the first. I hope that makes sense. I did a short video but it won’t let me post it here. If you still need help and feel comfortable, you can add me to your world or even a blank world and I’ll show you how to do it.