Skip to main content
added 4 characters in body
Source Link
doppelgreener
  • 7.3k
  • 7
  • 44
  • 69

While I'm pretty novice I thought I would chime in too! (ofc i'm open to feedback too!) IMO it seems you're pretty close.
Rather

Rather than making multiple scripts to hold different enemies at this early phase, I agree with DMGregory's suggestion of using 1 prefab with different inputs. After

After Instantiating the prefab enemy object I like to make a reference to the objects script in the EnemyManage object so i can call the different classes and assign values:

public GameObject EnemyPrefab; public Enemy EnemyScript; public void CreateBlueEnemy { myInstance = Instantiate(myPrefab, parentTransform); EnemyScript = myInstance.GetComponent<Enemy>(); EnemyScript.Damage = 1; }

public GameObject EnemyPrefab;
public Enemy EnemyScript;
public void CreateBlueEnemy
{
    myInstance = Instantiate(myPrefab, parentTransform);
    EnemyScript = myInstance.GetComponent<Enemy>();
    EnemyScript.Damage = 1;
}

While I'm pretty novice I thought I would chime in too! (ofc i'm open to feedback too!) IMO it seems you're pretty close.
Rather than making multiple scripts to hold different enemies at this early phase, I agree with DMGregory's suggestion of using 1 prefab with different inputs. After Instantiating the prefab enemy object I like to make a reference to the objects script in the EnemyManage object so i can call the different classes and assign values:

public GameObject EnemyPrefab; public Enemy EnemyScript; public void CreateBlueEnemy { myInstance = Instantiate(myPrefab, parentTransform); EnemyScript = myInstance.GetComponent<Enemy>(); EnemyScript.Damage = 1; }

While I'm pretty novice I thought I would chime in too! (ofc i'm open to feedback too!) IMO it seems you're pretty close.

Rather than making multiple scripts to hold different enemies at this early phase, I agree with DMGregory's suggestion of using 1 prefab with different inputs.

After Instantiating the prefab enemy object I like to make a reference to the objects script in the EnemyManage object so i can call the different classes and assign values:

public GameObject EnemyPrefab;
public Enemy EnemyScript;
public void CreateBlueEnemy
{
    myInstance = Instantiate(myPrefab, parentTransform);
    EnemyScript = myInstance.GetComponent<Enemy>();
    EnemyScript.Damage = 1;
}
Source Link

While I'm pretty novice I thought I would chime in too! (ofc i'm open to feedback too!) IMO it seems you're pretty close.
Rather than making multiple scripts to hold different enemies at this early phase, I agree with DMGregory's suggestion of using 1 prefab with different inputs. After Instantiating the prefab enemy object I like to make a reference to the objects script in the EnemyManage object so i can call the different classes and assign values:

public GameObject EnemyPrefab; public Enemy EnemyScript; public void CreateBlueEnemy { myInstance = Instantiate(myPrefab, parentTransform); EnemyScript = myInstance.GetComponent<Enemy>(); EnemyScript.Damage = 1; }