- Home /
Keep track of objects within a trigger.
I am trying to move ALL objects within a trigger. Is there a simple way to keep track of all items within a trigger? My current idea is to add the objects to an array and iterate through it with a for loop to move them. I would also remove the object from the array once they are outside of the trigger zone. I only see one problem with this - some of my objects have the same name (e.g. 5 objects named "Box") so if I add them to the array they'll have the same name which would cause problems when I try to remove them from the array. My idea to counter this is to check the name of the object every time I add an object to check for duplicates - if there is a duplicate, simply change the name of the object and then add it to the array. This is sort of on the backburner so I wanted some input and suggestions before I code it. Any help is greatly appreciated.
Your answer
Follow this Question
Related Questions
check if there are no object inside a trigger 2 Answers
Trigger Falling Object 1 Answer
Convert Object[] to List 3 Answers
GUI On button click change visibility of array objects 0 Answers
Retrigger animation after play through 0 Answers