|
Hi all. I am trying to destroy all of the objects in a scene with a certain tag, but I get error using my javascript code. Anyone can help me destroy the objects with tag using javascript code? I already declared in the objects prefab as "Model1" in tag manager. Can I declared multiple prefab w/ the same tag? I don't know how to apply findgameobjectswithtag in this section or any better solution for it. Thank you in advance.
(comments are locked)
|
(comments are locked)
|
|
Got error. It said, "not compatible with the argument list '()'." Please don't use Answer to "reply", on UA "Answer" means "Solution". There is an add new comment button hidden on the right. Also your comments will not require moderation.
Jun 17 '12 at 10:49 AM
whydoidoit
I've modified it and added a GameObject.Destroy() - not sure if that was it - on which line do you get the error?
Jun 17 '12 at 10:50 AM
whydoidoit
(comments are locked)
|
|
for js it would like this let me explain when accessing objects inside a tag you must create a way for it to cycle through each object, if you just state destory gameobjectwith tag then it will destroy only one, but add a simple loop then it will effect each of them. if say you only want to delete say five of ten objects then just replace length witth a number you could use this with other things as well for example heres a snippet from my code
(comments are locked)
|
