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 a third-person camera to follow our character

From the last section, we got the controllable character with the animation, but the camera isn't actually following the character at all. So, in this section we will create the third-person camera to follow our character.

Prepare for Lift Off

Create a new JavaScript in Unity by going to Assets | Create | JavaScript, and name it CharacterCamera. Then right-click on this script and click Sync MonoDevelop Project (or double-click it if we already set MonoDevelop as our main editor; if not it will open the default script editor, either Unitron or UniScite) to open MonoDevelop. Now we are ready to code.

Engage Thrusters

Now, we will begin coding the CharacterCamera script:

  1. Type the parameters script ...

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