|
Hey Guys, i'm with a problem here. I just can't hold the last object of an array(not his index, but the object attached to this index) and destroy it. I find out how to remove it from the array but I don't managed to remove it from the scene. If you guys want, here's the code ( Some variable names are in portuguese ); using System.Collections; using System.Collections.Generic; public class Teste : MonoBehaviour { } Variable meaning in English objetos = objects. posicao = position. prefabObjeto = objectPrefab. deslocamento = displacement. Hope yous guys may help me out in this. Thanks from now! *Sorry for my bad English.
(comments are locked)
|
|
You need to call Object.Destroy when removing the object from the list. Also you should test if posicao is not equal or greater than objetos.Count
(comments are locked)
|
|
Thanks, it works perfectly! :D
(comments are locked)
|
