GetDescendants Ignoring classes?

I was fixing a few bugs for a game and stumbled across a bug which im not sure is my lack of knowdledge or a bug. Help would be appreciated

Problem

I am looping through a for loop using a get decendents array here is the code -

			for i,v in pairs(car:WaitForChild("Wheels"):GetDescendants()) do
				if v:IsA("SpringConstraint") then
					print('debug1')
					v.FreeLength -= (ride2/10)
				end
			end

This wasnt working as it wasnt printing ‘debug1’ so I tried printing the array; I found out that the array did not include the spring constraint which was weird as it was a decendent of the wheels and also it only included parts and models not other instances, here is a screenshot of the wheels decendants

It clearly shows that a spring constraint is a descendent of the class ‘Wheels’ perhaps there is something im unsure about.

Any help would be appreciated

1 Like

Any errors in the output window?

1 Like

No, no errors in the output which was strange

1 Like

Maybe try double quotes instead of single:

print(“debug1”)

if it is still carrying out the function and just not printing.

1 Like

Double quotes do not matter at all since i use them for every string.

1 Like

I don’t think that will matter as I’ve also tried printing properties of the current value in the loop which wasn’t working

1 Like

Have you tried printing the classname?

Yes I have, I also said that I printed all the contents of :GetDecendents which had no spring constraints and was also not showing welds and body force

They probably havent loaded yet. Try putting task.wait(5) at the start.

can you print(v) in the for loop

I also have to mention that this was in a remote event and was only ran once you pressed the spawn button (ScreenGui)

So the task.wait is practically useless

I have already did that and it printed contents of the table which did not include a spring constraint

The remote event receiver is server-sided if you might wonder

is the spring locally created? (in local script)

ill have a look. Could be the problem…

Oh this actually fixed it, silly me thanks