Why do we need both tourretpivot AND tourret?

In the player prefab, we have created both TurretPivot and Turret.
TurretPivot has the network transform, and the turret child has the sprite renderer.

couldn’t we just have one “TurretPivot” and have both the network transform and sprite renderer?
why do we need to split them?

(for tankTreads and TankBody I can understand since there are two different sprites, but not for the turret…)

am I missing a best practice here?

Hi there,
It is a good practice to separate the parent object and create child objects when you have a moving component like this. Perhaps going forward you might want to have multiple sprites. Or the sprite might be animated, in which case it helps to have it separated from the parent transform.
The exception might be if you were planning on having a large number of Tanks in the game. With a larger enough number, the extra hierarchy item / gameObject could add to the memory requirements.
Otherwise, the flexibility provided by separating them is useful.

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

Privacy & Terms