// Use this for initialization void Start() { GameObject pc = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity) as GameObject; pc.name = "pc"; _toon = pc.GetComponent<PlayerCharacter>(); _toon.Awake(); _pointsLeft = STARTING_POINTS; for(int cnt = 0; cnt < Enum.GetValues(typeof(AttributeName)).Length; cnt++ ){ // loop through the player attributes _toon.getPrimaryAttribute(cnt).BaseValue = STARTING_VALUE; _pointsLeft -=(STARTING_VALUE-MIN_STARTING_ATTRIBUTE_VALUE); } _toon.StatUpdate(); }