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.
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.
Every Unity script inherits from MonoBehaviour. Attached to GameObjects.
using UnityEngine;public class PlayerController : MonoBehaviour {public float speed = 5f; // editable in Unity Inspectorprivate Rigidbody _rb;// Called once when scene startsvoid 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 physicsvoid FixedUpdate() {_rb.AddForce(Vector3.up * 9.8f);}// Called on collisionvoid OnCollisionEnter(Collision other) {Debug.Log($"Hit {other.gameObject.name}");}}
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: 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).
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.