…so I’m trying to implement a character creator as a stand-alone game (a project to wrap my head around Unity basics). The problem is: I’m instantiating scriptable objects to represent the different species a player can select from, but the stats I have in the scriptable objects aren’t tallying with the base scores. I’ve created a switch statement that’s attached to the buttons with Debug logging:
namespace Rep
{
public class SpeciesScores : MonoBehaviour
{
public int buttonID;
public Pteryx pteryx;
public HaamanRykul haamanRykul;
public Human human;
public Fae fae;
public Doargedran doargedran;
public Marsupian marsupian;
public Savuin savuin;
public Folk folk;
public Species species;
public void GetSpecies()
{
switch(buttonID)
{
case 1:
pteryx = ScriptableObject.CreateInstance<Pteryx>();
Debug.Log("I found a Pteryx egg!");
break;
case 2:
haamanRykul = ScriptableObject.CreateInstance<HaamanRykul>();
Debug.Log("I found an Haaman embryo!");
break;
case 3:
human = ScriptableObject.CreateInstance<Human>();
Debug.Log("I found a Human baby!");
break;
case 4:
fae = ScriptableObject.CreateInstance<Fae>();
Debug.Log("I found a Fae spawn!");
break;
case 5:
doargedran = ScriptableObject.CreateInstance<Doargedran>();
Debug.Log("I found a Doargedran baby!");
break;
case 6:
marsupian = ScriptableObject.CreateInstance<Marsupian>();
Debug.Log("I found a Marsupian embryo!");
break;
case 7:
savuin = ScriptableObject.CreateInstance<Savuin>();
Debug.Log("I found a Savuin spawn!");
break;
case 8:
folk = ScriptableObject.CreateInstance<Folk>();
Debug.Log("I found a Folk grommet!");
break;
default:
species = null;
break;
}
}
}
}
…and I have one of the stat scripts calling this method:
namespace Rep
{
public class Ambition : MonoBehaviour
{
SpeciesScores speciesScores;
public float ambition;
public Text ambitionScore;
public void Awake()
{
ambition = 1;
ambitionScore.text = ambition.ToString();
}
public void SpeciesScore(Species species)
{
speciesScores = GameObject.FindGameObjectWithTag("SpeciesScores").GetComponent<SpeciesScores>();
speciesScores.GetSpecies();
speciesScores.ToString();
}
}
}
I’m stumped as to what I’m missing; I get no compile errors and all the tutorials I’ve looked at haven’t amounted to squat - even the Unity Discord servers are getting sick of me
Any & all help appreciated - apologies for the code-dump