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
- 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 (often0). Check the Inspector field and set it to10. - Script Component Disabled: Check the little checkbox next to your script name in the Inspector to make sure it is enabled.
- Paused Time (
Time.timeScale == 0): If your game paused (e.g. death screen / menu),Time.deltaTimebecomes0, freezing all movement multiplied by delta time. - Rigidbody Position Constraints: Check if Freeze Position X/Y/Z is enabled in Rigidbody constraints.