So I have an empty object; my player. Depending on the direction it faces, it scales by -1. Therefore, the scale is -1 when facing left, and 1 when facing right, it also has some collision boxes and a sprite renderer. When I move, it scales with the direction. But I add an empty object as a child to my player, and I find out it doesn’t scale with the player. When my camera was a child to the player, it scaled. So how can I make this empty object scale? It’s odd, because my player is an empty object and IT scales, but the Empty child doesnt scale.
When you say the child object doesn’t scale, do you mean that the scale component of the transform stays at 1, 1, 1? Because if that’s what you mean, then that’s exactly the expected behavior. The child transform will be combined with the parent’s transform so that the end result will have the child scaled like the parent.
Does that make sense?
Not really, sorry…
The Camera scales with the player (when its childed), I dont see why an empty object shoudnt.
Empty objects are scaled as well. What makes you think it is not scaled?
I didnt know that it crosses itself out, so I assumed when the player scaled to -1, the empty would as well (to get to -1)
Sorry, I don’t understand what you mean.
Every GameObject has a Transform even if it is empty. The scale values of a Transform are measured relative to the Transform’s parent.
Example:
GameObject 1
Parent: None
Local scale: (-1, -1, -1)
World (lossy) scale: (-1, -1, -1)
GameObject 2
Parent: GameObject 1
Local scale: (1, 1, 1)
World (lossy) scale: (-1, -1, -1)
Note that when you edit the transform’s scale in the inspector, it will show the local scale, not the world scale.