Why is the script not finding something that's clearly there?

I’m trying to make a script to test out a jumpscare and When I make the line to reference the jumpscare part It keeps saying infinite yield I checked the spelling it is was right so Can someone help?

2 Likes

Use :WaitForChild() on the part
Example;
local Part = workspace:WaitForChild(“Part”)

2 Likes

I did use WaitForChild but It still can’t find it

1 Like

Scripting problem

local Baldi = game.Workspace:WaitForChild("Baldi")
local JumpscarePart = Baldi:WaitForChild("JumpscarePart")
local Player = game.Players.LocalPlayer
local Camera = game.Workspace.CurrentCamera

wait(3)

Camera.CFrame = JumpscarePart.CFrame

Capitalization matters

local Baldi = game.Workspace:WaitForChild("Baldi")
local JumpscarePart = Baldi:WaitForChild("JumpScarePart")
local Player = game.Players.LocalPlayer
local Camera = game.Workspace.CurrentCamera

wait(3)

Camera.CFrame = JumpscarePart.CFrame

Fixed the capitalization its still not find it

Same InfiniteYield? Or is it a different error?

Its the same InfiniteYield error

Can you send me a screenshot of the exact infiniteyield error, there’s some poor scripting practices in your code, but nothing I really see that could be causing that if the explorer image is correct, could be being really dumb right now too, but I just wanna see the infinite yield to check

I fixed it by using FindFirstChild

1 Like

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