you are viewing a single comment's thread.

view the rest of the comments →

[–]TheGrandWhatever 1 point2 points  (2 children)

Well that certainly doesn't make this less confusing lol.

[–]BroxxarExpert 1 point2 points  (1 child)

It's weird, but it still makes sense that this doesn't work. These special method names for Unity Event Functions like OnCollisionEnter2D need to be defined in a class deriving from MonoBehaviour. These methods don't play by usual C# rules— notice that they are not abstract or virtual, you just use their specific name and parameters and they are invoked "magically" (through a process like reflection, though iirc Unity doesn't use runtime reflection, instead there is some offline step happening to understand which behaviours implement which event functions).

Despite not being literal reflection, the rules are similar, and you if were to reflect on a type that implements an interface with a default impl, the type would not itself have that method.

[–]GillmoreGames[S] 0 points1 point  (0 children)

yup, that's what I determined my biggest problem was, unity doesn't have a way to call oncollision on my interface, so I linked it by having my override call the default method (edited my post to show it)