SCRIPTING • MOVEMENT

Unity GameObject Not Moving With Script

Step-by-step diagnostic checklist when your player, vehicle, or enemy remains completely stationary.

Quick Diagnostic Checklist

  1. Inspector Speed Variable Override: If you initialized float moveSpeed = 10f; in code, but previously attached the script to the GameObject, the Inspector stored the old value (often 0). Check the Inspector field and set it to 10.
  2. Script Component Disabled: Check the little checkbox next to your script name in the Inspector to make sure it is enabled.
  3. Paused Time (Time.timeScale == 0): If your game paused (e.g. death screen / menu), Time.deltaTime becomes 0, freezing all movement multiplied by delta time.
  4. Rigidbody Position Constraints: Check if Freeze Position X/Y/Z is enabled in Rigidbody constraints.

Movement Guides