Attempt to concatenate nil with string

I am debugging my code, since it doesnt work properly. This line is my debugger and it prints attempt to concatenate nil with string. This is the line of code I have problem with:

warn(BallName.." does not equal "..script.Parent.Parent.Parent.ViewportFrame.WorldModel:FindFirstChildWhichIsA("Part").Name)

Either one of these things concatenated could be nil, and roblox doesn’t support concatenating nil with string, or use string interpolation which works with anything

warn(`{BallName} does not equal {script.Parent.Parent.Parent.ViewportFrame.WorldModel:FindFirstChildWhichIsA("Part").Name}`)

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