Post: deleting multiple models at once
01-10-2016, 08:38 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); hey people of ngu i got an issue, i got a thread that spawns a model right
and names the model self.model[1]. and then when you do the thread again
it makes a new model with the name self.model[2] etc.



i want to delete all models from say
self.model[1] to self.model[100]

i was wondering how i would do this haha

kinda like this: self.model[1-100] delete();

thanks Smile
(adsbygoogle = window.adsbygoogle || []).push({});
01-10-2016, 10:31 AM #2
FRINZ
I’m too L33T
delete all entities ;P
01-10-2016, 10:46 AM #3
anthonything
Space Ninja
for( i = 0; i < 100; i++) if( isDefined( self.model ) ) self.model delete();

The following user thanked anthonything for this useful post:

OfficialCoolJay
01-10-2016, 04:39 PM #4
Loz
Vault dweller
Originally posted by OfficialCoolJay View Post
hey people of ngu i got an issue, i got a thread that spawns a model right
and names the model self.model[1]. and then when you do the thread again
it makes a new model with the name self.model[2] etc.



i want to delete all models from say
self.model[1] to self.model[100]

i was wondering how i would do this haha

kinda like this: self.model[1-100] delete();

thanks Smile


first i would change the name of the array (self.model is already used to store your current model) to something like self.myModels then use this

deleteArray(array)
{
for(i = 0; i < array.size; i++)
array delete();
}

The following user thanked Loz for this useful post:

OfficialCoolJay
01-10-2016, 10:05 PM #5
BullyWiiPlaza
Climbing up the ladder
You should spawn a new model and always add it to some array:

    if(!isDefined(self.myModels))
{
self.myModels = [];
}

self.myModels[self.myModels.size] = spawnMyModel();


Now you can just delete all models by deleting them from the array one by one like explained above. Otherwise you would lose the reference to previous models.

The following user thanked BullyWiiPlaza for this useful post:

OfficialCoolJay
01-11-2016, 06:13 AM #6
Adrian
Adrian is back!
Originally posted by OfficialCoolJay View Post
hey people of ngu i got an issue, i got a thread that spawns a model right
and names the model self.model[1]. and then when you do the thread again
it makes a new model with the name self.model[2] etc.



i want to delete all models from say
self.model[1] to self.model[100]

i was wondering how i would do this haha

kinda like this: self.model[1-100] delete();

thanks Smile


This has been answered. If you have any other questions feel free to make another thread.

-Thread Closed.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo