Original message (verbatim)
NullReferenceException: Object reference not set to an instance of an object
Placeholders such as %s / %d are kept verbatim from the engine source and are not replaced with concrete values.
Trigger
The script accesses a reference that was never assigned or was destroyed: an empty Inspector field, a missed GetComponent, or an object still referenced after Destroy.
Typical cause
.NET throws NRE when dereferencing a null reference; in Unity the usual causes are an unassigned serialized field, a failed component lookup, or a cross-scene reference to a freed object.
Step-by-step fix
- Null-check the reference before reading a field or calling a method.
- Assign missing fields in the Inspector and confirm GetComponent / Find hits the target.
- Clear the reference after the object is destroyed; avoid holding a fake-null reference.
Source links
Per-entry sources and capture date are listed at /sources#U18.
Related errors
Related Unity errors
Need an offline quick-reference checklist?
Atlas error library Pro pack: 123 error references (110 single + 13 merged) plus a quick-fix guide, $19 one-time purchase, delivered as electronic files.
Back to the all-errors index Checkout and buy the Pro pack — $19.00