But what if you wanted the prefab to be instantiated in a different position? Simple, move it and update
the prefab.
8. Drag the rock prefab into the Hierarchy view.
It appears in the scene, right where you originally put it.
9. In the Scene view, move it off to the side a bit.
Now you will need to update the prefab to register the transform change.
1. At the top of the Inspector, on the prefab line, click Apply.
2. Delete the moved rock from the scene.
3. Click Play and drive the rock into the zone.
4. It is instantiated in the new position.
5. Exit Play mode.
If you wanted to include several rocks in the prefab, you could put them all in an empty GameObject and drag
that back onto the prefab; using that method gives a warning about overwriting but allows you to make more serious
changes to an existing prefab.
As an added benefit, once an object or group of objects has been turned into a prefab, you can export the prefab
as a Unity Package.
Let’s make a Unity Package from the Rock Prefab after making a few improvements.
1. Select the rock prefab in the Project view.
2. Add a Mesh Collider.
3. Check Convex.
This won’t be as accurate as the full Mesh Collider, but it will use less resources to calculate while giving better
results than a simple sphere collider.
4. Select Wood for the Physics Material.
5. Next, add a Rigidbody component.
411