A 3D kart racing game built by Unity
game engine and C#
. Github Repo
Unity has some default methods for MonoBehaviour base class (most classes many scripts derive from). For example the void Start()
method is called whenever a object is instantiated from a class. void Update()
is the method that is called every time the game frame gets updated. void OnTriggerEnte()
executtes whenever the object collide (physics is handled by Unity engine) with another object.
An example is the class that is used to count the laps the player has finished: