Class 10
8th January 2025
Builds and Scenes
In this final class we are exploring how to make builds. But also a lot of input on Quality Settings, Polish Levels, tips on outreach,...
unity
builds
game
๐
1
๐ง ๐ 1
Tutorials
Build Profiles in Unity 6
Export on Godot (Windows)
Export on Godot (Mac)
Cheatsheets
Triggers, GetComponent, Switching Scenes
PrintTriggers
React to something entering a trigger
private void OnTriggerEnter(Collider other){
Debug.Log("Fish entered, name is:");
Debug.Log(other.gameObject.name);
}
GetComponent
GetComponent on itself
void Start(){
GetComponent<CatScript>().healthPoints = 5;
GetComponent<CatScript>().Meow();
}
GetComponent on other GameObject
public GameObject dog;
void Start(){
dog.GetComponent<DogScript>().healthPoints = 5;
dog.GetComponent<DogScript>().Bark();
}
Making variables/functions accessible in DogScript
public int healthPoints = 1;
public void Bark(){
Debug.Log("Dog is barking!");
}
Scene Management
Switching Scenes
void Start(){
UnityEngine.SceneManagement.SceneManager.LoadScene("SceneName");
}