Game Dev Notes #1 – Race Car

These are notes from the Complete C# Unity Game Developer 2D Udemy Course

Debug

Debug.Log( "Message" );
Debug message to console.

Collision

Add components:

  • [Shape] Collider (2D)
    • Play with the shape depending on what kind of collision feel you want.
  • Rigid Body
    • Turn gravity to 0 if this is not a platformer
    • Add rigid bodies to other objects if you want them to be pushed.

Scripts:

OnCollisionEnter2D
When colliding with something.

OnTriggerEnter2D
When passing through an trigger object.

Referencing Other Objects

There are a few ways to reference other objects inside scripts.

[SerializeFiled] GameObject <name>
This will create a field in the object’s inspector that you can manually select from the list. This then stores that object in the variable name you set the GameObject to.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s