Unity Basics Flashcards
How do you add physics to a gameobject?
Add a rigidbody component
When is FixedUpdate called?
Before performing any physics calculations
When is Update() called?
Before rendering a frame
What is an easy way to have the camera follow a gameobject?
Make the camera a child of the gameobject
Which Update() is best used to follow cameras, procedural animations, and gathering last known states?
LateUpdate()
What is a prefab?
A prefab is an asset that contains a template or blueprint of a game object or game object family
What happens when you make a change to a prefab?
All of the prefab instances in the game will be updated with the changes.
How to make a game object dynamic?
Add a collider and a rigid body
What determines whether a collider is static or not?
Whether or not it has a rigid body
How do you prevent an object with rigid body from reacting to physics?
Make the rigid body kinematic
If a collider is moving or rotating (not static like a wall), what should you do to prevent the collider from being cached every frame?
Make the collider dynamic by adding a rigid body
How are kinematic rigid bodies moved?
By manipulating their transform
How do you use a mesh collider alongside a rigid body?
Mark it as convex
how would you write the value of a 0.0 float in unity c#?
0.0f
How would you make a custom class visible in the inspector and usable by other classes?
Add [System.Serializable] before the class
Name a shader that would remove black from a material (transparent)
Particles/Additive
What is the point of using mobile shaders?
They are a more efficient use of resources
What are the disadvantages of using mobile shaders
You lose some quality and control
How would you get the input key R?
Input.GetKeyDown(KeyCode.R)
How do you pivot around a selected object with camera?
Select an object and press F to focus on it. Then, you use the orbit tool, to rotate around that object (and its children).
Describe an easy way to add a texture to a material
Change shader to legacy/diffuse and then you can add a texture
What is directional light mainly used for
A global lighting such as the sun or moon.
What does the UV in UV mapping stand for?
X,Y and Z are spacial co-ordinates while U,V,W are surface/mesh co-ordinates. This process projects a texture map onto a 3D object. The letters “U” and “V” denote the axes of the 2D texture because “X”, “Y” and “Z” are already used to denote the axes of the 3D object in model space.
What are the two main ways that programs can respond to changes in the world?
Polling and Events


