I am working on an fps and for the attachment to work, I need to have a way where the surface GUI is exactly in the center of my scope part so that it perfectly fits with the mouse. The problem I have is that I am pretty much terrible with UI and GUI overall, so I have no clue how to do so. I'm hoping that this is possible or there is some way to know what the offset has to be depending on the size of the image. Thanks!
The SurfaceGui itself has no visuals, it just provides you with a container to put UI elements in, and some control over the overall pixel resolution. You can easily center things by adding a Frame child to the SurfaceGui with Size of (1,0,1,0) (that's UDim2.new(1,0,1,0) in code) and Position of all zeros. This frame fills the SurfaceGui, and can be set transparent. Then, anything you want centered, you just make it a child of the Frame and set AnchorPoint to (0.5, 0.5) and Position to (0.5, 0, 0.5, 0) That's 0.5 for the Scale values, and 0 for the pixel offsets.