Prototyping a 2d action roguelike(Enter The Gungeon/Nuclear Throne influenced) and I’m trying to figure out the difference between these two lines of code, and a sample use case for both:
-
Using Instantiate to spawn a bullet prefab
Instantiate (bullet, transform.position, Quaternion.identity);
vs
-
Instantiating a prefab bullet as a GameObject
GameObject projectile = Instantiate (bullet, transform.position, Quaternion.identity) as GameObject;
I’ve been searching around, and can find similar topics but none that address this question in this fashion(however that may be because of my search terms). Appreciate any help, thank you.