I am following the live training here: Create an Ability System with Scriptable Objects - Unity Learn
It is a great series, but if I try to give an AI character the ability to use one of the abilties, say ProjectileAbility, then the initialization function
private ProjectileShootTriggerable launcher;
public override void Initialize(GameObject obj)
{
launcher = obj.GetComponent<ProjectileShootTriggerable> ();
launcher.projectileForce = projectileForce;
launcher.projectile = projectile;
}
causes only the latest instantiated character game object’s ProjectileShootTrigger to be referenced for ALL usages of the scriptable object.
Am I missing something here? Or is there a more appropriate way to be calling a function on a gameobject component from the scriptable object?