Best way to handle animation within a rotated object?

Is this the best way to handle this? Currently I have a polyomino shape and within each square it will be a garden vegetable (all the same) within that one polyomino.
But when I rotate the shape the animation turns sideways. So I just created one animation for each 90 degree rotation of the polyomino.

Then when the basic polyomino is placed down after rotation, I replace the polyomino with the proper animation one to show the garden growing.

But is there a better way to do this? In the end this will require me to create several animation (about 4 times as many). Yes I know some polyominos will really only need two because they are the same at 0/180 and 90/270 degrees (like the one in my example).


The tetris shape could be a parent game object, without the plants. Then, you could attach a child game object to the tetris shape that contains the plants. When you rotate the parent, do not rotate the child.

Tetris Object
→ Sprite
→ Plant Object
------> Sprites

I don’t know if it’s possible to disable the parent’s rotation from propagating downward to the child in Defold. If it is possible, then nice. Otherwise, you could apply the opposite rotation to the plant object, such that its resulting rotation value is always zero.

2 Likes

We currently cannot lock rotation on child objects/components

I’d do what @WhiteBoxDev suggests, and counter-rotate the sprite children (separate game objects with sprites)

1 Like

Thanks all. One more question. So do to this I’d need to use a collection factory then? I’m new to collection factory, so before I jump in with both feet I want to make sure that is the way I have to do this.