Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a SurfaceGui go to the center of the screen?

Asked by 2 years ago

So I've been trying to make a reticle for my shooting game and I just can't find out how to get the reticle to the center of the screen.

1 answer

Log in to vote
0
Answered by
niroqeo 123
2 years ago

AnchorPoint.

uiObject.AnchorPoint = Vector2.new(0.5,0.5)
uiObject.Position = UDim2.new(0.5,0,0.5,0)

should do the trick

0
Hello, sorry I was a bit unclear so what i am trying to achieve is putting the surface gui in the center of the camera so when you aim in then you can see the reticle and it moves when you move the gun aceYT1993 0 — 2y
0
Wouldn't a ScreenGui be more fit for a gun reticle than a SurfaceGui? niroqeo 123 — 2y
0
But if you need to use a SurfaceGui, you could lock the mouse into the middle of the screen and have the surface gui move to the mouse every frame. niroqeo 123 — 2y
Ad

Answer this question