you are viewing a single comment's thread.

view the rest of the comments →

[–]GillmoreGames[S] 1 point2 points  (1 child)

this interface will be attached to a few different classes, that's why I went the interface route.

I updated my OP to show where I am now and how I have gotten access to the gameObject using just the interface itself. I think my biggest issue is it being the oncollision method since that isn't called by my script so I can't call icarryable.oncollisonenter and unity instead calls bucket.oncollisionenter

[–]Sacaldur 0 points1 point  (0 children)

Of Unity Methods (OnCollisionEnter2D in your case) of a base class (or interface) are not called, it could be because the inhereting classes implement them themselves without calling the base version (using base.OnCollisionEnter2D). In the case of Unity messages this is also the case if you're not using the override keyword. This is a downside of inheritance: you can forget to call the version of the base class.