Reader small image

You're reading from  Unity Certified Programmer Exam Guide - Second Edition

Product typeBook
Published inMay 2022
Reading LevelIntermediate
PublisherPackt
ISBN-139781803246215
Edition2nd Edition
Languages
Right arrow
Author (1)
Philip Walker
Philip Walker
author image
Philip Walker

Philip Walker originally started as a 3D game artist, but then decided he wanted to combine his current skills with coding so that he could see through the majority of his games' and apps' development himself. Philip has worked in various different industries as an artist and as a Unity developer using various types of technology and techniques.
Read more about Philip Walker

Right arrow

Selecting game objects with raycasts

In this section, we are going to create the final shop script, PlayerShipBuild. This script holds properties such as selecting any button from the selection grid, running adverts, communicating with our existing game framework scripts, launching our game to play, and a few other things that we will cover.

One of the subjects you will likely come across in your Unity programmer exam and when developing games/applications in Unity is shooting invisible lasers, which are used for things such as shooting a gun, making a selection in three-dimensional space, and more. In this section, we are going to make a button on the selection grid light up blue when the player presses on it to let them know that it has been selected. We already have each of our buttons set up with blue rectangles that are permanently on. So, all that we need to do now is turn them all off when the scene becomes active and make any of the buttons turn on when a ray (invisible...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity Certified Programmer Exam Guide - Second Edition
Published in: May 2022Publisher: PacktISBN-13: 9781803246215

Author (1)

author image
Philip Walker

Philip Walker originally started as a 3D game artist, but then decided he wanted to combine his current skills with coding so that he could see through the majority of his games' and apps' development himself. Philip has worked in various different industries as an artist and as a Unity developer using various types of technology and techniques.
Read more about Philip Walker