Title explains it, I've tried everything. I know i can do IngoreGuiInSet, but i can't just figure out how to do get the center.
COMMUNITY QUESTION
How do you get the center of the screen with Vector2?
2 answers
Set your anchor point to 0.5, 0.5.
https://developer.roblox.com/en-us/api-reference/property/GuiObject/AnchorPoint
1 comment
0
This isn't for a gui! This is NOT what i meant!
If you're using ScreenGuis, use UDim2.
Assuming that a LocalScript is inside your GUI:
local centerScreen = UDim2.new(0, 0, 0, 0)
local gui = script.Parent
gui.Position = centerScreen
If you don't know what UDim2 is, here are the roles of the numbers in it:
UDim2.new(x scale, x offset, y scale, y offset)
I suggest editing the scales, because the offset's size doesn't change according to the device's size.
1 comment
0
Once again, not for a gui! I'm using it to shoot a raycast towards the center of the player's screen.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
use scale, Vector2.new(0.5,0,0.5,0) is the center
Tried this before, didn't work. The center was so far up to the left and up.
Mmm... did you set the AnchorPoint to 0.5, 0.5?
if u didn't thats why that happens.