I’m looking to replicate a style similar to the one shown below.
Ideally I want the GUI to be slanted inwards (Similar to the left menu) & to be located on the bottom left of the Players screen; I’m having difficulty figuring how to get this to work?
I’ve attached my code below however it is 100% not the outcome I’m looking for.
local Core = { ... }
local Server, Self = game, script
local RunService = Server:GetService('RunService')
local UserInputService = Server:GetService('UserInputService')
local Camera = Server:GetService('Workspace'):WaitForChild('Camera', 1)
--||--||--||--||
local Part = Instance.new('Part', Camera)
Part.Anchored = true
Part.CanCollide = false
--||--||--||--||
RunService.RenderStepped:Connect(function(...)
Part.CFrame = (Camera.CFrame + Camera.CFrame.LookVector * 10) - Camera.CFrame.RightVector * 8 - Camera.CFrame.UpVector * 5
end)
--||--||--||--||
return Core
They’re using a SurfaceGui or a BillboardGui to project the UI from a part. You can set the adornee of the Gui object to a part and it will work like a normal ScreenGui.
Hi, thanks!
Sorry it’s the actual coding side that I’m struggling with.
i.e. having the slanted part persistently located at the bottom left of the Players screen to allow the SurfaceGui to be linked.
CFraming the part to the screen is dependent on the resolution of the player’s screen. That means you might have players with mobile devices, laptops, or even a big screen TV. So if you’re wanting to keep the UI in view, you will have to CFrame the parts relative to something that everyone can see, which will be ScreenGui, dot product, or raycasting from the camera’s point of view. So far, you’re using RunService to move the Gui, so that’s a good start. I would look into how to reference a physical part’s position to a Gui object’s position.