Godot 2D Alien Attack scale/rotating sprites -v- scale/rotating scene

@kaanalpar

In the course we create rocket and enemy scenes (Area2D). In each have a sprite2D and collisionshape2D each of which we scale and rotate.

Is this advantageous over scaling and rotating the parent Area2D?

BTW loving your course Kaan, your teaching style is great.

Hi Dare2,

There are a number of reasons that you would want to avoid adding transforms (scale and rotation) to the parent object as it can create undesired effects.
Firstly it can distort the children nodes but also affect the collision shapes especially if you have non uniform scaling (IE 1, 2.5, 1) which is something we want to avoid.
If using textures as well this can cause distortion, tearing or stretching of those textures so its better to do this on the child objects to avoid this.
Its not so much of an issue here as we are in 2D but in 3D this can also cause a performance issue as non uniform scalnig can cause computation increases and slow down your game.

Hope this helps

2 Likes

That did help, thank you.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms