Hello! I recently tried to program a game and wanted to create weapons with different abilities rather than just stats. So while I was searching for answers, I came across this post, which answered how to add functions to scriptable objects. However, I am a little confused about the application. In my project, I have a simple scriptable object called WeaponHandler
public class WeaponHandler : ScriptableObject
{
public string Name;
public GameObject Object;
public Sprite Icon;
//animation
public float Cooldown;
public float AttackDamage;
public int Ammo;
public virtual void OnUse()
{
Debug.Log("customize this");
}
//on hit
}
And In it, I created a scriptable object called “Katana” in the editor. I tried to mutate the OnUse function by making another class named Katana in the same file and mutating the function like this.
class Katana : WeaponHandler
{
public override void OnUse()
{
Debug.Log("Katana");
}
}
However, when I call the function from the Katana object it writes “customize this”. How would I actually store a custom function in a Scriptable Object?

