Unity Certification Training Material
Unity Certification Training Material
Material
For Unity Certified User Programmer
Course
Scripts : Scripts allow you to customize and extend the capabilities of your
applicaton with C# code. With scripts that derive from Unity’s built-
in MonoBehaviour class you can create your own custom Components to
control the behavior of GameObjects.
By Khan Azish Ahmed
Animation basics
(Animation Controller and
State Machines).
By Khan Azish Ahmed 9
Point to Ponder : When images are imported in
2D mode, Unity interprets them as 2D sprites
Mini 2D Game rather than textures that are intended to be
wrapped around a 3D object.
Script •Start() -> method is called before the first frame update, but
only if the GameObject is active
•Update() -> method is called once per frame. This is where you
implement behaviors that need to happen continuously
Null-Conditional (?.):
•Safely access members, returns null if the object is null.
Example:
• int? value = obj?.SomeProperty; // No exception, returns
null
void Update()
{
// If the timer is less than the defined spawn rate
if (timer < spawnRate)
{
// Increment the timer by the time taken for
the current frame
timer += Time.deltaTime;
}
else
{
// Spawn a new pipe at the spawner's position
and rotation
Instantiate(pipe, transform.position,
transform.rotation);
// Reset the timer to zero to start counting
for the next spawn
timer = 0;
}
}
By Khan Azish Ahmed 24
Pipe Spawner Script
We have issue that first pipe spawns after a very long interval so we will
add the instantiate in start method as well. But instead of making multiple
copies of the instantiate method we will do by making a different method
for it.
1. Create Animations
folder
2. Create a new
Animation controller
and Animation Clip in
the folder
3. Add them to the Player
by drag & drop to
inspector windows.
1. Create Animations
folder.
2. Create a new Animation
controller int the folder.
3. Add them to the Player
by drag & drop to
inspector windows.