about list.clear(); problem


Register the newly created clones as a list and control them
At first it works fine when I press the Play button in Unity and run it.
Once you turn the playback on and off, the MoveCubes section does not work.
When Unity turns itself on, it’s good again.
As the clones that were created disappear
I guess I’m getting an error because the list is still there.
Is there any way to solve this problem?

I think at some point when you turn off playback
I think we should initialize the list with list.Clear ();
I can not find any answer.
Thank you for informing me.

I would change

public List<GameObject> m_listcube;


public List<GameObject> m_listcube = new List<GameObject>();

Also remove


I have no idea if this would solve your problem. But definitely worth a try.