I am creating a GameObject with script and add components like:
card = new GameObject();
card.AddComponent<SpriteRenderer>();
...which works well.
What does not work is to add the script.s
I have a script, "KD_CardScript", stored in the Unity Editor, tested under Assets/Scripts as well as Assets/Resources and is trying to add that script to card using primarily:
card.AddComponent<KD_CardScript>();
...which does not work as it cannot find KD_CardScript. I have googled and tried a few other things with no success.
Is there anyone nice that can lead a blind and show how to do this?