Game Development Reference
In-Depth Information
Tip
When we add the
Box Collider
component to the new object,
Box Collider
will
automatically adjust its size to fit around the object. This is why we don't have to
set up the size or the position of
Box Collider
.
15. Now add the
Rocket
script to the
rocket
object in
Hierarchy
and set up the
In-
spector
as follows:
Rigidbody
Use Gravity
Uncheck
Rocket (script)
Explosion Particle
Explosion
(drag from the
Project
view that we just created)
16. We need to create the prefab of the
rocket
object by dragging it to the
Re-
sources/Prefabs
folder in the
Project
view and removing the
rocket
object
from our
Hierarchy
view by right-clicking and choosing
Delete
. Now, we have
got our
rocket
prefab.
17. After that, we will create the
Smoke
particle by going to
GameObject
|
Create
Other
|
Particle System
; name it
Smoke
. Drag it inside our
gun_model
object in
Hierarchy
, as shown in the following screenshot:
18. Go to the
Inspector
view of
Smoke
and set it as follows:
Transform