How can you rotate a group of 3d objects all along the middle? When I try, it rotates each individual object without changing the position of them.
it does this if I try:
Set their origins so that they are all at the same coordinate and aligned. Or use the pin behavior to pin the pieces together.
You can do this to rotate around any center.
Var a, centerX, centerY Set position to (self.x-centerX)*cos(a)-(self.y-centerY)*sin(a)+centerX, (self.x-centerX)*sin(a)+(self.y-centerY)*cos(a)+centerY Rotate clockwise by a degrees
You can do this to rotate around any center. Var a, centerX, centerY Set position to (self.x-centerX)*cos(a)-(self.y-centerY)*sin(a)+centerX, (self.x-centerX)*sin(a)+(self.y-centerY)*cos(a)+centerY Rotate clockwise by a degrees
where do I input this? I'm fairly new to construct and also don't know anything about scripting
R0J0hound
Develop games in your browser. Powerful, performant & highly capable.
It’s events. Make three variables names centerX, centerY and a. Set them to whatever you want. Then make an every tick event and add a set position and rotate action for those objects and use those expressions.
So this rotates all of the objects so that the 3d shapes are all rotated, correct? R0J0hound
Yes, I thought that’s what you were after and that’s why I posted it.
When I typed the code, it glitches out in the game and teleports back and forth. I just want to be able to rotate it while in the editor. R0J0hound
Example:
dropbox.com/s/wmra64o0xervngk/rotateAroundCenter.capx
You can do it in the editor as well. Select the objects, press enter and then you can rotate them together.
That's exactly what I was looking for! Pressing enter helped. Thank you! R0J0hound