Script seems to not be working correctly

Hello, I am working on a little game for fun and I’ve come across an issue that I have no clue why is happening.

So I have a system, Theres a model called “PlatformLevels” in this model contains six other models that all have a part in them called “PlatformDetector”.

The goal I am making is that when the game runs, a script will go into each of these models, get the part that is named “PlatformDetector”, and set a attribute in that part to true.

The Script:

Problem that I’m having is, the first 3 models go through but when it comes to the other 3 (4, 5 and 6) it doesn’t go through and I have no idea why.

There isn’t any error that pops up and I even tried putting a print on line 7 to see how many times it goes through, and it only goes through 3 times.

I checked to make sure spelling was right on the code and the models name and everything seems well, I have no idea why this is happening so I came here for an answer, any help is appreciated!

1 Like

Could you show more, please? We can’t really know why something is going wrong with only what you said. ( Or atleast i cant, im not that good of a scripter. )

1 Like

Like what Raymarched said, there’s not a whole lot to go with that one screenshot.

Could you at least provide the Explorer?

Hey I’m gonna remake this topic because I just happened to solve the issue but now came across another one, appreciate you guys for trying to help and sorry for not being clear enough!

3 Likes