How do I go about making a sniper scope that is compatible for both PC and mobile?

Hello, I have been working on some snipers for my gun game. I have most of the mechanics down but I recently came across an issue with it. Whenever the player scopes in to shoot, the scope GUI is not completely centered in the middle of the screen, and it varies from devices. This causes issues because then the middle of the scope is not accurate to where the player is actually aiming.I tried using the scope as a mouse icon which did work, but the issue there is that mobile does not use mouse icons. Currently my closest solution is just trying to offset it enough to my screen but then I experience issues when shooting at long range. I am looking for something compatible for both PC and mobile. Any suggestions are appreciated. I am sure I missed somethings about it so if you have any questions feel free to ask.

TLDR: Middle of scope does not line up with middle of the screen even after using anchor point .5,.5. Resulting in the gun being inaccurate.

Some examples of the scope problem:

Close Range

Long Range

1 Like

For PC you could do a left click, for mobile you could make a button for them to go into scope.

Oh right, sorry if that part wasn’t clear. So yes I have done that already, the problem is that the GUI is not perfectly centered for whatever reason. And when I fire to the center of the screen it doesn’t match up with the scope. I did try using an anchor point of .5,.5 but that was still off.

What are you using to determine where the bullet is fired? It seems like you just need to set IgnoreGuiInset to true on the ScreenGui of the scope image, because you fire based on the mouse.

2 Likes

Is there a script for scope? I would like that since there is not really many guns that have compatibility for mobile.

2 Likes