Hello Guest

Author Topic: Whack a Mole. Instantiating a MoleUnit prefab causes Unity hang later on  (Read 4088 times)

Romeno

  • Newbie
  • *
  • Posts: 1
    • View Profile
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?