SurfaceGui's Adornee returning nil

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to get the SurfaceGui’s Adornee.

  2. What is the issue? When printing, it returns as nil.

  3. What solutions have you tried so far? I have tried to get the SurfaceGui with Localplayer.

local TargetsFolder = script.Parent.TargetsFolder
local TargetExample = script.Parent.TargetExample
local plr = game.Players.LocalPlayer
local Model = script.Parent.Parent.Adornee
print(Model)

Please show a ss of output tab. Its possible you need to use

local TargetsFolder = script.Parent:WaitForChild("TargetsFolder")
local TargetsExample = script.Parent:WaitForChild("TargetsExample")
local plr = game.Players.LocalPlayer
local Model = script.Parent.Parent.Adornee
print(Model.Name)

This is a local script right? Please also screenshot the script and its “elders”

1 Like