Original message (verbatim)
CS0019: Operator 'operator' cannot be applied to operands of type 'type' and 'type'
Placeholders such as %s / %d are kept verbatim from the engine source and are not replaced with concrete values.
Trigger
A comparison or arithmetic operation is applied to two types that do not support the operator (string and number, null and value type, or a custom type without an operator overload), and compilation reports CS0019.
Typical cause
The compiler cannot find a matching operator overload and cannot apply the operator to these two operands.
Step-by-step fix
- Verify both operands share a compatible or comparable type.
- Convert types before numeric arithmetic.
- Use Equals for reference comparison, or overload the operator for custom types.
Source links
Per-entry sources and capture date are listed at /sources#U26.
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