Inserting ClickDetectors through script or manually?

I’ve currently got about 100 models in which each model needs around 5 ClickDetectors inserting in different parts. Would it be best to go round each and every model and insert the ClickDetectors or would it be best to use something such as a for loop and insert them manually? How much would this affect something such as the loading time for the game and would it cause any lag? I don’t mind doing either, it’s just which would be the best option?

1 Like

I think manually… 30 charssssssss

1 Like

Because first of all, inserting it through the script could cause lag and preformance drop. And u might get confused, i guess u could but all the click detectors in a folder and name the folder therefore it will be much easier, and when u want to remove a click detector then u could just go to the folder and remove it but if u want to remove it from a script u would have to look down all that code just to remove something.

1 Like

Depends on what would take the least amount of time. Manually putting clickdetectors inside every model seems like a waste of time. I would use the command bar to insert them into your game. But you could also use a script to insert them on startup.

2 Likes

It won’t affect performance. And if you have to edit code to remove one specific ClickDetector then you’ve programmed it badly.

It would likely look for a specific name, a CollectionService tag, or all items inside a model or folder. To remove one you’d just move it out the folder, change the name, remove the tag, or whatever technique the person wants to use.

Note: the reply originally mentioned searching through the code to remove an individual ClickDetector.

1 Like

Alright, thank u for the input…

Yeah, I understand and I needn’t have any reason to remove just a single ClickDetector as they’re all going to stay in the models. The solution about using the command bar was the chosen one for anyone looking for an answer; simply just used a for loop and inserted it manually in every model as they were already in a folder.

1 Like