Interfaces vs Scriptable Objects

Based on what little I know from the previous courses, I was anticipating the weapon system being based on scriptable objects. Instead we are introduced to Interfaces, which seem to operate in a similar fashion?

When approaching a project, when would you want to use an Interface, and when would you want to use a Scriptable Object?

We’re actually using both an interface and a ScriptableObject. The IWeapon interface with the Attack method will go on our prefab, which will be instantiated as we change weapons. The ScriptableObject WeaponInfo will contain information about the weapon and a link to the weapon prefab (which should have a class with the IWeapon interface on it.

It should make more sense as we get through the Instantiating Weapons section.

3 Likes

Managed to not notice that the very next section is Scriptable Objects :man_facepalming:
Thank you!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms