Why create Interface ?

If it is something that you can do in a global function, go right ahead, absolutely don’t add indirection where you don’t need it :slight_smile:

Where they shine is when used to abstract things, be they actual things or actions, e.g. is some actor the player just clicked on ‘interactable’? or ‘hitable’? If so you can cast to the interface and send a message to whatever it is saying “I’m interacting with you now” without having to know anything about what it actually is (other than it implements the interactable interface), which is good for numerous reasons.

1 Like