Adornee not being an instance

So I’m trying to get a Proximity prompt to work. Its in a part in the workspace.
And to get it to work trough a localscript, Im trying to locate it by going trough a surfaceGui.Adornee.
image
The surfaceGui itself is in StarterGui. The code thats in the surfacegui looks something like this:

local insertPrompt = script.Parent.Adornee.Parent

But it outputs:

Players.PowWow_TheGreat.PlayerGui.ATMGuis.Original.ATMManager:9: attempt to index nil with 'Parent' 

Even tho the adornee is clearly set to the Screen part.

I dont understand why the SurfaceGui.Adornee doesnt bring me inside the ATM Model even tho it clearly is…

All I’m trying to do is identify the Proximity Prompt in my localScript. But its impossible by going trough game.Workspace. Anyone knows why it doesnt detect anything after accessing the SurfaceGui.Adornee?

Maybe try this

local insertPrompt = script.Parent.Adornee

It works, but it only identifies Screen
And I need to locate CardPrompt

Can you send me a screenshot of where “card prompt” is?

Look up ^
image

You can locate card prompt like this:

local WS = game:GetService("Workspace")
local CardPrompt = WS:WaitForChild("ATM").Card.CardPrompt

Or putting a script into the card prompt:

local CardPromopt = script.Parent

This wont work since there is plenty of atms in the map… And I need to specify THE one that the player is near…
I just dont understand why script.Parent.Adornee doesnt bring me to Screen

Try the updated version i gave you.

Use script.Parent.Parent:WaitForChild(“Screen”)

Im assuming the surfacegui is in the screen part?

No its not. Since players interact with it, it has to be in playergui.
Reason why I HAVE to go trough the SurfaceGui.Adornee.
But Idk why it doesnt work…

Can you add me to team create? OR use this:

local Players = game:GetService("Players")
local player = Players.LocalPlayer

local SurfaceGui = player.PlayerGui.SurfaceGui

This wont help me… All I need to do is make my localscript find the proximity prompt by going trough the surfaceGui Adornee…

Add me to teamcreate please. ‎‎‎ ‎‏‏‎ ‎‏‏‎ ‎

Nah im good, Ill find another way

OK, if you say so. Have a nice day.

You too! Thanks for the help tho

Found the solution. It has nothing to do with any of this!