Hello all,
I’m having a weird issue with unity.
When destroying GameObjects Unity creates a “New Game Object” GameObject into the outliner when the game is still running.
Here is my destroy call :
private void DestroyBlock()
{
if (this.gameObject.transform.parent.gameObject)
{
gameController.RemoveBlockInMap(id);
Destroy(this.gameObject.transform.parent.gameObject);
}
}
void FixedUpdate () {
if (blockCountAround != 8) {
Invoke("DestroyBlock", lifeDuration);
}
else
{
CancelInvoke("DestroyBlock");
}
transform.Rotate(0.0f, Time.deltaTime * rotationSpeed, 0.0f);
}
Here is the problem ingame :
Each time I destroy a GameObject “PRE_BlockCoin” Unity creates me a “New Game Object”.
Thanks,