2D Toolkit Forum

2D Toolkit => Support => Topic started by: Romeno on October 27, 2013, 07:55:40 am

Title: Whack a Mole. Instantiating a MoleUnit prefab causes Unity hang later on
Post by: Romeno on October 27, 2013, 07:55:40 am
Hi!

I'm quite new to Unity and 2D Toolkit. I followed all steps in Whack a Mole tutorial. Everything worked fine so I decided to add some dynamic. I deleted all MoleUnits from the scene and added a code to MainGameScript.Start
Instantiate(molePrefab, new Vector3(24.36694f, 25.0f, 5.0f), Quaternion.identity);

before the
yield return 0; 

The moles with their holes are created fine, get whacked, go up and down. But after a period of time Unity hangs. And it is always when one of the moles goes down. I tried to debug and log to find the cause of it with no avail.
Can you help me, am I doing something wrong?