Why use the "virtual" keyword when declaring a method in U#?

I’m getting this warning on a U# script which I didn’t write:

warning CS0114: 'Sync_Toggle.Interact()' hides inherited member 'UdonSharpBehaviour.Interact()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.

In that script, the method is declared like this:
public virtual void Interact() { // code }

I’d like to avoid that console warning, although it doesn’t seem to affect anything. Why did the author of this script use the “virtual” keyword, and what might I break if I change it to “override”?

You’ll come across plenty of jargon for coding in this, but you can learn the differences between Virtual and Override in this Unity video.

Long story short, “Virtual” is used for events that you plan to “Override” in other scripts, so the user here is creating a version of Interact that is brand new. Of course, Interact already exists, so it will give you this warning. You will also get this same warning by doing a simple “private void Interact()” despite this having the exact same working functionality.

Optimally, you should always have VRChat events that you are replacing be written like “public override void Interact()” as that is what Unity is expecting and will not give you any warnings. No issues should arise from simply swapping the word Virtual in this event to Override.

So I do understand that virtual declares a method that can be overridden by another method that inherits from it. I still don’t understand why an Udon user would want to do that instead of just always using override.

In Udon Sharp, you’re always supposed to inherit from UdonSharpBehaviour, right? So you shouldn’t ever be overriding your own virtual method since you shouldn’t ever be inheriting it?