Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
First-person controls, terrain & environment
@shahedC
WakeUpAndCode.com
Initial Setup, Asset Store
> First-Person Controls
> Terrain, Trees, Colliders
> Textures, Grass & Rocks, Water
Wrap-Up
Click Edit  Preferences
Under External Tools, select your Script Editor
e.g. MonoDevelop or Visual Studio
Tip: Browse for...
http://code.visualstudio.com
http://darkgenesis.zenithmoon.com/configuring-unity3d-to-use-the-new-lightweight-visual-studio-code-
editor/
1. Click Edit...
http://unreferencedinstance.com/how-to-integrate-visual-studio-code-with-unity3d-project/
1. Click Assets  Sync MonoDevel...
Double-click Script file
On the top menu,
1. Click View
2. Click Theme
3. Choose a theme:
• Light Theme
• Dark Theme
• High Contrast Theme
On the top menu,
1. Click Window
2. Click Asset Store
Shortcut: Ctrl+9
Verify that
you’re logged in.
Scroll down
for top charts
Click on
Top Free
(below
Top Paid)
Initial Setup, Asset Store
> First-Person Controls
> Terrain, Trees, Colliders
> Textures, Grass & Rocks, Water
Wrap-Up
… choose 3D, then click “Create project”
Name your project…
Click File  New Project…
From top menu, click GameObject  3D Object  Plane
Click Assets  Import Package  Characters
Import All!
In the Project Panel,
Open the following:
• Standard Assets
• Characters
• FirstPersonCharacter
• Prefabs
• FPSController
Click Play button, move with arrow keys
Notice
FPSController
in Hierachy
Locate FirstPersonController script under:
/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/
From top menu, click GameObject  3D Object  Terrain
Click Play button, move with arrow keys
In the Terrain’s Inspector window, click Edit Trees  Add Tree
In the Add Tree dialog, click the tiny circle, then choose a tree, e.g. Banyan
Click the Add button to confirm.
Click “Mass Place Trees, then click Place to confirm
Too Small!
In the
Project panel,
click the Prefab
for the tree you
selected,
e.g. Banyan
Enter a larger
Scale Factor
e.g. 1
Click App...
From Project panel, drag any tree prefab to the Scene
Path: /Assets/Terrain Assets/Trees Ambient-Occlusion/
With the tree selected in the Hierarchy, click Add Component  Physics  Capsule Collider in the Inspector panel
Rename it, e.g. “BanyanCollider”
NOTE: You may now delete the tree from the Hierarchy.
1. Click “Place Trees” tool in Inspector with Terrain selected in Hierarchy
2. Click Edit Trees… to Add Tree (prefab with ...
Click Assets  Import Package  Environment
Import All!
1. Click “Paint Texture” tool
2. Click Edit Textures…
3. Click Add Texture…
1
2
3
1. Click Select button
2. Choose a Texture, e.g. SandAlbedo
3. Click Add
1
2
3
1. Click Select button
2. Choose another Texture, e.g. Mud Rocky Albedo and Mud Rocky Normal
3. Click Add
1
2
3
With new Texture selected, drag mouse cursor along terrain to apply it.
1. Click Select button
2. Choose another Texture, e.g. Grassy Hill Albedo
3. Click Add
1
2
3
With new Texture selected, drag mouse cursor along terrain to apply it.
1. Click “Paint Details” tool
2. Click Edit Details…
3. Click Add Grass Texture…
1
2
3
1. Click icon next to Detail Texture
2. Choose a Grass Texture, e.g. Grass Hill Albedo
3. Click Add
1
2
3
1. Click “Paint Details” tool
2. Click Edit Details…
3. Click Add Detail Mesh…
1
2
3
1. Click icon next to Detail Texture
2. Choose a Rock Texture, e.g. Rock Mesh
3. Update color and change Render Mode (Vert...
With Grass/Rock selected, drag mouse cursor along terrain to apply each.
1. Drag
RockMesh into
Scene.
2. Rename it in
Hierachy.
3. Create empty
Prefab, and
drag rock into
it.
1
2
3
With the rock selected in the Hierarchy, click Add Component  Physics  Capsule Collider in the Inspector panel
Initial Setup, Asset Store
> First-Person Controls
> Terrain, Trees, Colliders
> Textures, Grass & Rocks, Water
Wrap-Up
http://1drv.ms/1TUMufE
Drag “bazooka” prefab into “FirstPersonCharacter”
(just below FPSController)
Adjust Position:
X, Y and Z values
Adjust Position:
X, Y and Z values
http://facebook.com/groups/UnityIndieDevs
http://WakeUpAndCode.com/unity
http://facebook.com/groups/XboxOneIndieDevs
http:...
Email: shchowd@microsoft.com  Twitter: @shahedC
Initial Setup, Asset Store
> First-Person Controls
> Terrain, Trees, Colliders
> Textures, Grass & Rocks, Water
Wrap-Up
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Upcoming SlideShare
Loading in …5
×

Unity 5: First-Person Tutorial

12,064 views

Published on

Blog post: http://wakeupandcode.com/unity-5-first-person-tutorial

Ready to build a 3D first-person game in Unity? This presentation material was put together for a live audience for my in-person presentations, but you can also follow along online with the detailed screenshots and instructions.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Unity 5: First-Person Tutorial

  1. 1. First-person controls, terrain & environment @shahedC WakeUpAndCode.com
  2. 2. Initial Setup, Asset Store > First-Person Controls > Terrain, Trees, Colliders > Textures, Grass & Rocks, Water Wrap-Up
  3. 3. Click Edit  Preferences Under External Tools, select your Script Editor e.g. MonoDevelop or Visual Studio Tip: Browse for devenv.exe in your Program Files folder if you don’t see Visual Studio "C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEdevenv.exe"
  4. 4. http://code.visualstudio.com
  5. 5. http://darkgenesis.zenithmoon.com/configuring-unity3d-to-use-the-new-lightweight-visual-studio-code- editor/ 1. Click Edit  Preferences 2. External Tools 3. Browse to: • “C:Users<profile>AppDataLocalCodeBin” 4. Select code.cmd OPTIONAL: In VS Code, open the project folder to use Intellisense
  6. 6. http://unreferencedinstance.com/how-to-integrate-visual-studio-code-with-unity3d-project/ 1. Click Assets  Sync MonoDevelop Project 2. Open VS Code, pick project folder 3. Pick a project (-csharp.sln) file
  7. 7. Double-click Script file
  8. 8. On the top menu, 1. Click View 2. Click Theme 3. Choose a theme: • Light Theme • Dark Theme • High Contrast Theme
  9. 9. On the top menu, 1. Click Window 2. Click Asset Store Shortcut: Ctrl+9
  10. 10. Verify that you’re logged in.
  11. 11. Scroll down for top charts
  12. 12. Click on Top Free (below Top Paid)
  13. 13. Initial Setup, Asset Store > First-Person Controls > Terrain, Trees, Colliders > Textures, Grass & Rocks, Water Wrap-Up
  14. 14. … choose 3D, then click “Create project” Name your project… Click File  New Project…
  15. 15. From top menu, click GameObject  3D Object  Plane
  16. 16. Click Assets  Import Package  Characters Import All!
  17. 17. In the Project Panel, Open the following: • Standard Assets • Characters • FirstPersonCharacter • Prefabs • FPSController
  18. 18. Click Play button, move with arrow keys Notice FPSController in Hierachy
  19. 19. Locate FirstPersonController script under: /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/
  20. 20. From top menu, click GameObject  3D Object  Terrain
  21. 21. Click Play button, move with arrow keys
  22. 22. In the Terrain’s Inspector window, click Edit Trees  Add Tree
  23. 23. In the Add Tree dialog, click the tiny circle, then choose a tree, e.g. Banyan
  24. 24. Click the Add button to confirm.
  25. 25. Click “Mass Place Trees, then click Place to confirm
  26. 26. Too Small!
  27. 27. In the Project panel, click the Prefab for the tree you selected, e.g. Banyan Enter a larger Scale Factor e.g. 1 Click Apply to update all trees!
  28. 28. From Project panel, drag any tree prefab to the Scene Path: /Assets/Terrain Assets/Trees Ambient-Occlusion/
  29. 29. With the tree selected in the Hierarchy, click Add Component  Physics  Capsule Collider in the Inspector panel
  30. 30. Rename it, e.g. “BanyanCollider”
  31. 31. NOTE: You may now delete the tree from the Hierarchy.
  32. 32. 1. Click “Place Trees” tool in Inspector with Terrain selected in Hierarchy 2. Click Edit Trees… to Add Tree (prefab with collider) 3. Mass Place Trees! 3 2 1
  33. 33. Click Assets  Import Package  Environment Import All!
  34. 34. 1. Click “Paint Texture” tool 2. Click Edit Textures… 3. Click Add Texture… 1 2 3
  35. 35. 1. Click Select button 2. Choose a Texture, e.g. SandAlbedo 3. Click Add 1 2 3
  36. 36. 1. Click Select button 2. Choose another Texture, e.g. Mud Rocky Albedo and Mud Rocky Normal 3. Click Add 1 2 3
  37. 37. With new Texture selected, drag mouse cursor along terrain to apply it.
  38. 38. 1. Click Select button 2. Choose another Texture, e.g. Grassy Hill Albedo 3. Click Add 1 2 3
  39. 39. With new Texture selected, drag mouse cursor along terrain to apply it.
  40. 40. 1. Click “Paint Details” tool 2. Click Edit Details… 3. Click Add Grass Texture… 1 2 3
  41. 41. 1. Click icon next to Detail Texture 2. Choose a Grass Texture, e.g. Grass Hill Albedo 3. Click Add 1 2 3
  42. 42. 1. Click “Paint Details” tool 2. Click Edit Details… 3. Click Add Detail Mesh… 1 2 3
  43. 43. 1. Click icon next to Detail Texture 2. Choose a Rock Texture, e.g. Rock Mesh 3. Update color and change Render Mode (Vertex Lit) 4. Click Add 1 2 4 3
  44. 44. With Grass/Rock selected, drag mouse cursor along terrain to apply each.
  45. 45. 1. Drag RockMesh into Scene. 2. Rename it in Hierachy. 3. Create empty Prefab, and drag rock into it. 1 2 3
  46. 46. With the rock selected in the Hierarchy, click Add Component  Physics  Capsule Collider in the Inspector panel
  47. 47. Initial Setup, Asset Store > First-Person Controls > Terrain, Trees, Colliders > Textures, Grass & Rocks, Water Wrap-Up
  48. 48. http://1drv.ms/1TUMufE
  49. 49. Drag “bazooka” prefab into “FirstPersonCharacter” (just below FPSController)
  50. 50. Adjust Position: X, Y and Z values
  51. 51. Adjust Position: X, Y and Z values
  52. 52. http://facebook.com/groups/UnityIndieDevs http://WakeUpAndCode.com/unity http://facebook.com/groups/XboxOneIndieDevs http://WakeUpAndCode.com/xb1
  53. 53. Email: shchowd@microsoft.com  Twitter: @shahedC
  54. 54. Initial Setup, Asset Store > First-Person Controls > Terrain, Trees, Colliders > Textures, Grass & Rocks, Water Wrap-Up

×