Original message (verbatim)
CS0266: Cannot implicitly convert type 'type1' to 'type2'. An explicit conversion exists (are you missing a cast?)
Placeholders such as %s / %d are kept verbatim from the engine source and are not replaced with concrete values.
Trigger
An assignment or argument passes one type where an incompatible type is expected (base class to derived class, mismatched numeric types, interface to implementing class), and the compiler reports CS0266.
Typical cause
There is no implicit conversion operator between the two types; the compiler only finds an explicit conversion path and rejects the implicit assignment.
Step-by-step fix
- Insert an explicit cast with a null or as-failure check at the assignment.
- Verify the declared variable type matches the actual object type.
- Use an explicit conversion or TryParse for mismatched numeric types.
Source links
Per-entry sources and capture date are listed at /sources#U24.
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