Billboard gui does not appear in correct position

Hello,
I have created a system that there are houses in replicated storage and when you play they get cloned to a random spawn in the workspace.
Then I added a billbord gui in starter gui and I made a local script that makes the adornee to the local player house.
Here it is:

    wait(1)

    local player = game:GetService("Players").LocalPlayer
    local playerHM = game.Workspace:FindFirstChild(string.format("%sHouseManager", player.Name))
    local BGpart = playerHM.House.MailBox.BGpart
    local Adornee = script.Parent.Adornee --BGpart


    print(BGpart)
    print(BGpart.Parent)

    Adornee = playerHM.House.MailBox.BGpart

This how it looks in the explorer:sddsddf

Help is very much appreciated.

The print statements both work.

If you don’t understand something you can tell me.

I won’t be online soon so please reply!

We work for free and we’re all pretty much asleep or we have jobs, be patient. It can often take more than 20 minutes to get results.
What position does it appear at currently? How exactly is it going wrong?

Sorry for all the pressure.
It pretty much appears in a random position,I think it is in the center of the world(0,0,0).

Oh I see the issue.
When you say
local Adornee = script.Parent.Adornee you are actually (more or less) copying script.Parent.Adornee, and using that copy to create a new variable.
When you say
Adornee = playerHM.House.MailBox.BGpart
instead of setting script.Parent.Adornee, you are just changing the local Adornee variable.
You should do this instead.

wait(1)
local player = game:GetService("Players").LocalPlayer
local playerHM = game.Workspace:FindFirstChild(string.format("%sHouseManager", player.Name))
local BGpart = playerHM.House.MailBox.BGpart
local gui = script.Parent
print(BGpart)
print(BGpart.Parent)
gui.Adornee = BGpart

It works!!!
Thank you so much!

1 Like