█
LastWrite
  • > Curriculum
  • > Pricing
  • > For Educators
  • > About
  • > Contact
Log InGet Started

Questions, concerns, bug reports, or suggestions? We read every message, write to us at [email protected].

More ways to reach us →
LastWrite

Structured computer science lessons for aspiring developers and security professionals.

[email protected]

(201) 785-7951

Mon–Fri, 9 AM–5 PM EST

Learn

  • Curriculum
  • Pricing

Company

  • About
  • For Educators & Schools
  • Contact Us

Legal

  • Terms of Service
  • Privacy Policy
© 2026 LastWrite. All rights reserved.
Curriculum/Programming Languages/C# and .NET/C# for Game Dev: Unity Intro
45 minBeginner

C# for Game Dev: Unity Intro

After this lesson, you will be able to: Get oriented in Unity: MonoBehaviour, Update vs FixedUpdate, GameObjects + Components.

Unity is the most-used game engine + C# is its scripting language. This lesson is a SURVEY, just enough to make Unity approachable when you sit down with it.

Prerequisites:Entity Framework Core

Why C# devs care about Unity

Unity is THE indie game engine. Also used in films, AR/VR, sims, training, architectural visualization. C# is the scripting language (Unity also has visual scripting, but C# is the primary). If you want to build games or AR/VR + you already know C#, Unity is a low-friction next step.

MonoBehaviour — the script base class

Every Unity script inherits from MonoBehaviour. Attached to GameObjects.

tsx
using UnityEngine;
public class PlayerController : MonoBehaviour {
public float speed = 5f; // editable in Unity Inspector
private Rigidbody _rb;
// Called once when scene starts
void Start() {
_rb = GetComponent<Rigidbody>();
}
// Called every frame (variable rate, 60+ Hz typically)
void Update() {
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
transform.position += new Vector3(h, 0, v) * speed * Time.deltaTime;
}
// Called at fixed timestep (50 Hz), use for physics
void FixedUpdate() {
_rb.AddForce(Vector3.up * 9.8f);
}
// Called on collision
void OnCollisionEnter(Collision other) {
Debug.Log($"Hit {other.gameObject.name}");
}
}

GameObjects + Components

GameObject = container. Has a Transform (position/rotation/scale) + zero or more Components. Components = pieces of behavior. Renderer (visuals), Rigidbody (physics), Collider (collision), AudioSource (sound), your custom MonoBehaviour scripts. Composition over inheritance, add the components you need, swap them at runtime.

Update vs FixedUpdate vs LateUpdate

Update: every rendered frame. Variable rate. Use for input, animation, camera following. Multiply by Time.deltaTime for frame-rate-independent motion. FixedUpdate: every 0.02s (50 Hz) by default. Use for physics + Rigidbody operations. LateUpdate: after all Updates. Use for camera follow (so it tracks the player AFTER the player moved).

💡 Unity learning path

Unity Learn (free, official): unitylearn.com. Brackeys (YouTube): the classic Unity intro series. First project: roll-a-ball or 2D platformer, Unity's own tutorials. Realistic timeline: 100 hours to a shippable small game. Modern Unity uses Universal Render Pipeline (URP) for most projects.

Common mistakes

Doing physics in Update instead of FixedUpdate (frame-rate-dependent behavior). Forgetting `* Time.deltaTime` in Update (different speeds on different machines). GetComponent in Update (slow, cache in Start). Direct transform.position changes on a Rigidbody (breaks physics, use rb.MovePosition).

Sign in and purchase access to unlock this lesson.

Sign in to purchase
←Entity Framework Core
Back to C# and .NET
Testing in C#→