Hey guys, I’m new to scripting but been trying to get better little by little. Right now I’m kind of confused with something and I’m sure it’s stupid simple but I just don’t see it.
I have the following scripts
public class Ability : MonoBehavior {
public virtual void HandleAbility ();
}
public class Dash : Ability {
public override void HandleAbility () {
// Do Dash
}
}
public class Player : MonoBehavior {
public Ability ability;
void Update () {
ability.HandleAbility ();
}
}
Now my issue is that I want to be able to assign the Dash.cs script to the ability variable in Player.cs but I’m not able to do so even when the Dash.cs script is already derived from Ability.cs. Not sure if I’m explaining my self correctly. Please help if you know a fix!