Fireship · @fireship

Unity in 100 Seconds

Uploaded March 7, 2022 · Length 2:45

Unity in 100 Seconds

Summary

unity game engine basics: building a 2d game in 100 seconds

  • unity game engine
  • 2d game development
  • c sharp programming
  • game development basics
  • unity tutorials

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    unity a cross-platform game engine for

  2. 0:02

    building 2d and 3d experiences made

  3. 0:04

    famous for democratizing the immense

  4. 0:06

    challenge of game development it was

  5. 0:08

    created in copenhagen denmark and first

  6. 0:10

    released in 2005. today it's the magic

  7. 0:12

    behind many popular games like the 2d

  8. 0:15

    among us

  9. 0:17

    the 3d monument valley augmented reality

  10. 0:19

    apps like pokemon go first-person

  11. 0:21

    shooters like escape from tarkov as well

  12. 0:23

    as interactive simulations and

  13. 0:25

    animations beyond the gaming industry

  14. 0:27

    the engine itself is written in c plus

  15. 0:29

    plus but allows developers to write

  16. 0:31

    their code in the more approachable c

  17. 0:32

    sharp in addition it provides a powerful

  18. 0:35

    graphical editor allowing you to draw

  19. 0:36

    shapes work with cameras and apply

  20. 0:38

    materials without having to write a

  21. 0:40

    single line of code every game object

  22. 0:42

    can have a variety of components like a

  23. 0:44

    mesh to define its actual physical shape

  24. 0:46

    a mesh renderer to apply materials and

  25. 0:48

    lighting to an object and physics

  26. 0:49

    components like rigidbody and colliders

  27. 0:52

    that simulate things like gravity and

  28. 0:54

    collisions in the real world and finally

  29. 0:56

    you can extend an object with your own c

  30. 0:58

    sharp code to make it do something

  31. 0:59

    interesting like take hit points when it

  32. 1:01

    runs into a bad guy to build your first

  33. 1:03

    video game right now install unity hub

  34. 1:05

    create a new project then open up the

  35. 1:07

    editor you'll be greeted with a 3d scene

  36. 1:09

    that contains a light source and a

  37. 1:11

    camera a scene is like a game level that

  38. 1:13

    you're developing while the camera is

  39. 1:14

    the point of view of the player to

  40. 1:16

    create a game of dodgeball let's add a

  41. 1:18

    plane to be the ground a cylinder for

  42. 1:20

    the player and a sphere for the ball

  43. 1:22

    select an object then hit y on your

  44. 1:24

    keyboard to move rotate and scale it to

  45. 1:26

    your liking hit the play button and

  46. 1:27

    notice how these shapes don't do

  47. 1:29

    anything but if we add a rigid body to

  48. 1:31

    the objects all of a sudden they're now

  49. 1:32

    impacted by the laws of gravity

  50. 1:34

    currently they look pretty boring but we

  51. 1:36

    can make them look cool by creating a

  52. 1:37

    material and then drag it onto the

  53. 1:39

    shapes and now to make this game

  54. 1:41

    playable let's add a script component to

  55. 1:42

    it and then open it in vs code it

  56. 1:44

    contains a class with two methods to

  57. 1:46

    implement your code start is called once

  58. 1:48

    at the very beginning of the game while

  59. 1:50

    update is called on every frame while

  60. 1:51

    the game is being played and there's

  61. 1:53

    also fixed update that runs at the same

  62. 1:55

    frame rate as the physics engine now to

  63. 1:57

    move our player around we can define a

  64. 1:58

    public property for the rigid body which