I tried CFraming the position of the brick, but when i turn around and open the screen it appears on my left or right in front of me.. Could you guide me please?
01 | function openScreen() |
02 | if deb = = false then deb = true |
03 | wait() |
04 | chr.Humanoid.WalkSpeed = 0 |
05 | local sb = game.ReplicatedStorage.inventoryScreen |
06 | local sb 2 = sb:Clone() |
07 | sb 2. Parent = chr |
08 | sb 2. CFrame = chr.Head.CFrame + Vector 3. new( 6 , 0 ,- 2 ) --Right here is the prob |
09 | plr.PlayerGui.UI.Adornee = sb 2 |
10 | plr.PlayerGui.UI.container.Visible = true |
11 | end |
12 | end |
Try using CFrame.new instead of Vector3.new. Like this
01 | function openScreen() |
02 | if deb = = false then deb = true |
03 | wait() |
04 | chr.Humanoid.WalkSpeed = 0 |
05 | local sb = game.ReplicatedStorage.inventoryScreen |
06 | local sb 2 = sb:Clone() |
07 | sb 2. Parent = chr |
08 | sb 2. CFrame = chr.Head.CFrame + CFrame.new( 6 , 0 ,- 2 ) --Right here is the prob |
09 | plr.PlayerGui.UI.Adornee = sb 2 |
10 | plr.PlayerGui.UI.container.Visible = true |
11 | end |
12 | end |
If that does not work, then your facing the wrong way. Either way. I hope this helps!