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

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

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

AnchorPoint.

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

should do the trick

3 comments

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

0

Wouldn't a ScreenGui be more fit for a gun reticle than a SurfaceGui?

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.

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