Billiards on Unity 3D

Teaching materials for the school of programming. Part 10

Spoiler

Previous tutorials can be found here:





  1. Spaceship





  2. Dominoes





  3. Flappy bird





  4. Gravity room





  5. Platformer





  6. Trees (plugin SpeedTree)





  7. Modeling a house in SketchUp





  8. House in the woods





  9. Rain effect. Particles









Dear Reader! ( pronounced in the voice of Nikolai Drozdov )





We are on the tenth anniversary project! Today, trying to avoid a clash with the morality police, consider creating a game - billiards. In this lesson, we will work with a material system, lighting, and learn how to use components and scripts without programming.

This article provides a description using the example of a completely finished project, but this does not change the order of work.





Execution order

Let's create a new 3D project and import the attached asset into it . The asset contains sounds, scripts and textures.





Let's put a plain on the stage and give it a size of about 100x1x100. Place the billiard table model on the plain.





Next, create a new material, apply a carpet texture to it, remove the shine, change the tiling (see screenshot) and drop it onto Plane.





: Light, , .





, .





Spot .





, Rigidbody , , Rubber.

Ball .





, .





, Reflection Probe .





. . FreeLookCameraRig. , , .





. , .





15 , . , Rigidbody .





, , . .





ImpactSound. .





, . UI->Image, .





, , .

, GameLogic.

AudioSource, PlayOnAwake Loop.





. , , is Trigger.





, 2001200 , , , . , , Player.





.

, Event Trigger Shoot . , .





, , :





GameLogic, . , .





- Score.





, 2 . , .





, , RestartAndExit .





. .





MaxScore GameLogic .





. , !












All Articles