O'Reilly logo

Unity 4 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a rocket launcher and RocketUI

In this final step, we will create the RocketLauncher and RocketUI scripts to make our robot actually shoot the rocket object, which we created in the previous step, by adding a script in our CharacterControl script to trigger them.

Engage thrusters

Let's get started. To create the RocketLauncher and RocketUI scripts, perform the following steps:

  1. First, in the Hierarchy view, we will create the RocketUI prefab by going to GameObject | Create Other | GUI Texture; name it RocketUI and set it as follows:

    Transform

    Position

    X: 0.9, Y: 0.08, and Z: 0

    Rotation

    X: 0, Y: 0, and Z: 0

    Scale

    X: 0, Y: 0, and Z: 1

    GUITexture

    Texture

    rocketUI (located in the Resources/UI folder in the Project ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required