First Project Tetris Hello World Rotation

Welcome aboard!

You can hide the box with box.setEnabled(false).

I think you should design your pieces to be centered at the (0,0,0) point. That way, there’s no anchor point and you will simply need to subtract the piece position before rotating:

You can do piece.blocks[i].instance.rotation.z -= Math.PI / 4; instead of piece.blocks[i].instance.rotation.z = angle.

You can group all the blocks of a piece in a single piece thanks to Mesh.MergeMeshes.

That seems fine to me :slight_smile:.

Using MergeMeshes will help simplify the code as you will only have to rotate a single mesh and you won’t need to use setPivotPoint. So, something along the line:

3 Likes