hi,
I created a gameobject and made it as prefab. I was trying to instantiate the prefab(gameObject) whenever there is touch response but at the same time i also wanted to delete the previous instance of prefab as soon as the new instance was created .
for eg:- whenever i will touch the screen, a new instance will be created. again i will touch the screen, another new instance will be created but also at the same time previous instance will be destoyed.
I managed to do till the creation of instance through touch but was not able to think a way of destroying the previous instance.
I was trying it to do it by Array , but i was not able to pinpoint the code.
Can someone help me. Will be really appreciated…
Language should be in c#
Thanks