Where it’s useful:
- Building a structure out of a single Prefab by replicating it multiple times in different positions, for example in a grid or circle formation.
- Firing a projectile Prefab from a launcher. The projectile Prefab could be a complex configuration containing a Mesh
, Rigidbody
, Collider
, AudioSource, Dynamic Light, and a child GameObject with its own trail Particle System
. - A vehicle, building or character, for example a robot, breaking apart into many pieces. In this scenario, the example script deletes and replaces the complete, operational robot Prefab with a wrecked robot Prefab. This wrecked Prefab consists of separate broken parts of the robot, each set up with Rigidbodies and Particle Systems of their own. This technique allows you to blow up a robot into many pieces, with just one line of code, which replaces the original GameObject with a wrecked Prefab.
https://docs.unity3d.com/Manual/InstantiatingPrefabs.html