How do I override the setter method of a property in C#?

The override is fine. However, as the error message states, you need to mark the property in the base class as virtual to be able to override it:

public virtual Vector2 Position

Unlike Java, class members are not virtual by default in C#. If you can’t change the base class, you’re out of luck.

Leave a Comment