Unity Tutorial 02: UI, Audio & Ray Tracing

Sure, I get it...
Source: Giphy

  This week on Unity - Some C# coding that I'm not gonna pretend I understand! I understand the functions that they performed, but the actual elements are going to take some time and practise to become as familiar as HTML and CSS. I've come across 'if' statements before, but I'm still unsure of what some of the more complex coding involving 'public', 'static', and 'Raycast' really do. I will definitely be researching some basic C# coding, to get a better idea of what these functions are doing behind the scenes.

  I began by adding a sound effect to the gem I created last week. This was a simple process that involved creating some subfolders and ticking some boxes. I can handle this much. Adding water was a much simpler process than I expected. After creating a dip in the terrain, I dragged and dropped in the water prefab and adjusted the desired height of the water. To create a wall, I added some new textures and materials. I was able to create the normal maps and the materials on my own, so at least I know some information is sticking.

  Then it was time to edit the User Interface somewhat. I was able to add a crosshair to the centre of the players screen to mark what is being aimed at. This was done by adding a square to centre screen, and then adjusting the size and rotation to create a small diamond. This can be further edited later on to create a dynamic crosshair that changes depending on what the user is pointing to.

  With the crosshair in place, the coding for Ray Casting came next. Ray casting is something that I never realised I knew nothing about until I went to implement it into my game. Now I know that it is a ray that goes from the start point straight ahead until it hits a solid object in the game. So far, I have set it that it marks the distance from the player to wherever the crosshair is pointing. It will be useful when it comes to debugging later on.

  While I am still unsure of C#, and would not yet be able to code on my own with no help from my good pal, Jimmy Vegas, I feel like I will get there soon enough. With some extra theory homework and a bit of patience I can become familiar with this new language.

If you look really closely, you will see a crosshair... And many, many pixels.

- Ultan

Comments

Popular posts from this blog

Introduction: How I Became Addicted

Alpha

Game Design: What is it?