Original message (verbatim)
CS0120: An object reference is required for the non-static field, method, or property 'member'
Placeholders such as %s / %d are kept verbatim from the engine source and are not replaced with concrete values.
Trigger
An instance member is called directly from a static method or static context (an instance field or method accessed without new-ing the object), and compilation reports CS0120.
Typical cause
Instance members depend on a concrete object; the static context has no this reference, so the compiler rejects direct access.
Step-by-step fix
- Create an instance of the class and access the member through that object.
- Or make the called member static if it does not depend on instance state.
- Check that the singleton or reference is passed into the static method.
Source links
Per-entry sources and capture date are listed at /sources#U28.
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