Hi my name is Dean and I’m twelve years old,
My brother Evan and I have been doing this class and have been succeeding and learning a lot this past summer, but recently we tried to run the Lazer Defender game and we are running into an error that causes Unity to freeze. This is very frustrating. I’m including a screen shot of the screen when it freezes and our code. We are only at lesson 7 of 30 and any help would be appreciated we can’t wait to finish this game.
Thank you,
Dean and Evan
I have been going through it and I found that I had inserted transform at the end of the “enemy.transform.parent” line and it had crashed Unity. Here is our code after it worked.
using UnityEngine;
using System.Collections;
public class EnemySpawner : MonoBehaviour {
public GameObject enemyPrefab;
// Use this for initialization
void Start () {
foreach( Transform child in transform){
GameObject enemy = Instantiate(enemyPrefab, new Vector3(0,5,0), Quaternion.identity) as GameObject;
enemy.transform.parent = child;
}
}
// Update is called once per frame
void Update () {
}
}
Well done for finding this yourselves Team DiCarlo 
The reason for the crash is due to Unity consuming lots of memory as the code becomes cyclic, e.g. goes round and round and round… you are not the first to experience this, you won’t be the last 
Thank you we have been working on this course all summer. It is awesome to make games!
That’s really great to hear, well done to you both.
Do feel free to share links to the games you put together for the community to have a look at, it can take a little bit of courage to open yourself up to feedback, but I have never seen anything on the forums here which hasn’t been given constructively and with the best of intentions.
Same goes for any issues/difficulties you run into, plenty of people here to offer their support if you or your brother need it - just ask 