Podcast
Questions and Answers
What is the main function of a shader in Unity?
What is the main function of a shader in Unity?
In Unity, why are most 3D models made up of triangles?
In Unity, why are most 3D models made up of triangles?
What is the purpose of a normal map in Unity?
What is the purpose of a normal map in Unity?
What does 'Skinned Mesh Animation' involve in Unity?
What does 'Skinned Mesh Animation' involve in Unity?
Signup and view all the answers
How does Unity handle lighting in 3D compared to 2D?
How does Unity handle lighting in 3D compared to 2D?
Signup and view all the answers
What is required to have an animated object in Unity?
What is required to have an animated object in Unity?
Signup and view all the answers
Which type of light in Unity casts light from a single point outward in a sphere around it?
Which type of light in Unity casts light from a single point outward in a sphere around it?
Signup and view all the answers
What does the Singleton pattern ensure in Unity?
What does the Singleton pattern ensure in Unity?
Signup and view all the answers
In Unity, what does Dynamic Friction refer to?
In Unity, what does Dynamic Friction refer to?
Signup and view all the answers
What is the difference between Discrete and Continuous collision detection in Unity?
What is the difference between Discrete and Continuous collision detection in Unity?
Signup and view all the answers
Study Notes
Rigging and Animation
- Rigging a model means setting up an internal skeleton that can be manipulated by an animator to move the model.
- To have an animated object in Unity, you need:
- A rigged model
- Animation for the rigged model
- An animator component on the Game Object
- An Animator Controller assigned to the Animator
- The Animator Controller holds all the separate animations and acts as an interface for your code.
Lighting
- There are three basic light types in Unity:
- Directional (e.g. sun)
- Point (e.g. hanging light bulb)
- Spot (e.g. spotlights)
- Directional lights cast light evenly across the scene and don't fade at a distance.
- Point lights cast light from a single point outward evenly in a sphere and fade out the further you get from the source.
- Spot lights cast light from a single point outward in a cone shape and fade out the further you get from the source.
GameObjects
- The
DontDestroyOnLoad
function can be used to move a GameObject between scenes without destroying it. - Example:
DontDestroyOnLoad(gameObject);
- A singleton is a code pattern that ensures only one instance of a GameObject exists.
- Example:
public class ScriptName : MonoBehaviour { static scriptName instance; ... }
Physics
- 3D physics is similar to 2D physics, with the addition of the Z axis.
- 3D and 2D physics do not collide.
- By default, Unity uses Discrete collision detection, which checks for collisions once per frame.
- Continuous collision detection checks for collisions once per frame and also checks in between frames, but takes a big performance hit.
Physics Materials
- Dynamic Friction is the friction of a moving body.
- Static Friction is how much friction must be overcome to start an object moving.
- Bounciness determines how much an object should bounce.
First Person Controls and Materials
- To rotate a game object towards the mouse's current position, you must first convert it to the same coordinate space.
- PlayerPrefs is not safe for saving important data.
- Materials use shaders to set properties of how the object will be drawn.
- Shaders can use various images, such as textures, provided by an artist.
- A normal map is a flat image that can be applied and interpreted in the shader.
2D and 3D
- Unity was built for 3D, but 2D was supported in Unity 4.
- 2D uses Orthographic Camera, while 3D uses Perspective Camera.
- 2D uses sprites, while 3D uses models.
- 2D lighting is calculated on sprites, while 3D lighting is calculated on models.
- Every 3D model is made up of lots of smaller flat triangles, known as polygons.
- Polygons are used because they are the most efficient for graphics calculations, textures, lighting, and shadows.
3D Animation
- Skinned Mesh Animation is the practice of moving each vertex of a 3D model relative to an internal skeleton.
- Rigging is the process of setting up how each point should move relative to the skeleton inside.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Learn about game development concepts in Unity, including PlayerPrefs, rotating game objects towards mouse position, different coordinate spaces, multiple scenes, 2D and 3D differences, cameras, sprites, models, lighting calculations, and more.