WaitForChild to search a "part" or "BasePart" is detected as "Instance" not "Part" nor "BasePart"

  • Descriptive title: So when you try to use WaitForChild function to search part, it detected as an instance not a part. So you need to specify the variable out like Local part:Part = workspace:WaitForChild('Part')

  • When it started happening: Today

  • Screenshots and videos of the bug:

    .
    Screenshot 2023-04-23 141403

  • Any help is appreciated

But type and typeof is not the class. If you want to check what type of class would be:

local thing = workspace:WaitForChild("A_Part")
warn(thing.ClassName) -- output Part

yea it would show as a part. but when you actually store it on a variable it detects as instance

1 Like

But that depends on what your function is returning isnt?
image

local thing = workspace:WaitForChild("A_Part")

local function getBullet(toRead)
	return toRead.ClassName
end
print(getBullet(thing))

its not a function its

local getbullet = bulletfolder:WaitForChild(script.Name)
print(getbullet.ClassName)

Restarting studio has no effect

I see what you mean now. But its not happening to me:

image

I think its an issue with your studio yes.

EDIT:
Ah my bad, I didnt notice you are using script.Name for the WaitForChild(), but thats intented I guess, I mean, the engine while you are scripting doesnt know yet what class is the thing inside the variable.

well, thats unfortunate. i think i might reinstall my studio

ahh… my bad… thats the whole problem. Thanks for the help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.