O'Reilly logo

Unity 3 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 the New3PSController and MouseLook_JS scripts

In the last section, we imported the Chapter5 Unity package and created our scene, which included all the basic setup. In this step, we will create a New3PSController script by using the old built-in FPSInputController script, and add some script to control the animation or the character to run, walk, aim, or shoot. We will also create the MouseLook_JS script, which is the JavaScript version of the MouseLook built-in script that is written in C#. The MouseLook_JS script is used to control the rotation of the camera in our scene.

Prepare for Lift Off

We are first going to create the New3PSController script.

We will start by creating a new MouseLook_JS by going to Assets | Create | Javascript

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