Presentation is loading. Please wait.

Presentation is loading. Please wait.

Based on Roll-a-ball video tutorial from Unity Technologies Part WakeUpAndCode.com.

Similar presentations


Presentation on theme: "Based on Roll-a-ball video tutorial from Unity Technologies Part WakeUpAndCode.com."— Presentation transcript:

1 Based on Roll-a-ball video tutorial from Unity Technologies Part 1 @shahedC WakeUpAndCode.com

2 Getting Started > Creating the Ground > Creating the Player > Materials, Colors & Lighting > 3D Physics & Movement Controlling the Camera

3

4

5

6 Select 3D (not 2D)Click [Create project]

7 Click Layout dropdown to select or save

8 Click File  Save Scene

9 Create New folder below Assets folder Name it “Scenes”

10 , then click [Save] … Name your scene “PlayingField.unity” Inside “Scenes” Subfolder…

11 Verify Saved Scene in Project panel Verify Scene Name in Title Bar

12

13 Click GameObject  3D Object  Plane Click Create  3D Object  Plane In the top menu…In the Hierarchy panel…- OR -

14

15 Right-click to rename Enter “Ground”

16 Select “Ground” in Hierarchy Click gear icon next to Transform then click “Reset”

17

18 With “Ground” selected in hierarchy… … press ‘F’ on your keyboard to focus on it … move your cursor to the Scene

19 Scroll the mouse wheel over your scene to zoom in/out

20 In the Scene panel, click the Gizmos dropdown to toggle “Show Grid”

21 Click on the Scale tool, while the Ground is selected… … then, drag the handles to resize the ground

22 Manually enter Scale values in the Ground’s Transform component Scale: X = 2, Y = 1, Z = 2

23

24 Click GameObject  3D Object  Sphere Click Create  3D Object  Sphere In the top menu…In the Hierarchy panel…- OR -

25 Position Sphere at X = 0, Y = 0.5, Z = 0

26

27

28 In the Project panel, click Create dropdown then, select “Folder”

29 In Project panel, click Create then, select “Folder” Rename it “Materials”

30 In Project panel, click Create then, select “Material” Rename it “GroundMaterial” Repeat for “BallMaterial”

31 For each material... Update color in Inspector window (click white square)

32 Red Green Blue Alpha (Transparency)

33 Verify that GroundMaterial and BallMaterial have different colors.

34 Drag each material from Project panel to the Scene panel

35 Update Direction Light in Inspector Rotation: X = 50, Y = 60, Z = 0

36

37 With “Ball” selected in the Hierarchy panel… Click Component  Physics  RigidBody

38 With “Ball” selected in the Hierarchy panel, click Add Component  Physics  Rigidbody

39 Verify RigidBody Component

40 In the Project panel, click Create dropdown Then select “Folder”, name it “Scripts”

41 In the Project panel, click Create dropdown Then select “C# Script”, name it PlayerController

42 With “Ball” selected... … Drag script into Ball Verify Script Component!

43

44 Add FixedUpdate() method … just before last curly brace

45 Inside FixedUpdate() method… Calculate 3D movement

46 Define rb just before Start() Initialize inside Start() method Add Force inside FixedUpdate()

47 Click Play button, move around with arrow keys!

48 Define public speed variable Multiply speed with movement

49 With “Ball” selected... Set Speed = 10 What happens if you set it to 100?

50 Click Play button, move around with arrow keys!

51

52 Set Camera Position and Rotation Position: X = 0, Y = 10, Z = -10 Rotation: X = 45, Y = 0, Z = 0

53 Camera should appear higher with a better view

54 In the Project panel, click Create dropdown Then select “C# Script”, name it CameraController

55

56 Define instance variables just before Start()

57 Initialize offset in Start() method

58 Add LateUpdate() method Then, set camera position

59 With “Main Camera” selected... … Drag script into camera Verify Script Component!

60 With “Main Camera” selected... … Drag Ball into Camera’s Player object

61 Click Play, move around!

62


Download ppt "Based on Roll-a-ball video tutorial from Unity Technologies Part WakeUpAndCode.com."

Similar presentations


Ads by Google