Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I make a brick always appear on the right side of my avatar?

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?

function openScreen()
	if deb == false then deb = true
		wait()
		chr.Humanoid.WalkSpeed = 0
		local sb = game.ReplicatedStorage.inventoryScreen
		local sb2 = sb:Clone()
		sb2.Parent = chr
		sb2.CFrame = chr.Head.CFrame + Vector3.new(6,0,-2) --Right here is the prob
		plr.PlayerGui.UI.Adornee = sb2
		plr.PlayerGui.UI.container.Visible = true
	end
end

1 answer

Try using CFrame.new instead of Vector3.new. Like this

function openScreen()
    if deb == false then deb = true
        wait()
        chr.Humanoid.WalkSpeed = 0
        local sb = game.ReplicatedStorage.inventoryScreen
        local sb2 = sb:Clone()
        sb2.Parent = chr
        sb2.CFrame = chr.Head.CFrame + CFrame.new(6,0,-2) --Right here is the prob
        plr.PlayerGui.UI.Adornee = sb2
        plr.PlayerGui.UI.container.Visible = true
    end
end

If that does not work, then your facing the wrong way. Either way. I hope this helps!

This discussion is preserved as it was. New answers, comments, and votes are closed.