How to differentiate between two sides of the screen?

  1. I am trying to make it displays a unit’s information such as so:

Whenever you click on a unit on the right side it displays that information bar to the left. Vice versa. If you click a unit on the left side it displays the information on the right. To make sure it always stays in the center of the screen.

Does anyone have a general idea on how to go about doing this? Basically a way to differentiate between two sides of the screen. It’s like knowing I am clicking closer to the left side of the screen versus the right.

I just need a general idea.

1 Like

https://devforum.roblox.com/t/how-do-i-get-the-exact-mouse-position/1618057/13

local mouse = player:GetMouse()


local function WhereIsMouse()
    if (mouse.x / mouse.ViewSizeX) <= (mouse.x / mouse.ViewSizeX) then
        print("mouse is on left side of screen")
    else
        print("mouse is on right side of screen")
    end
end)

*untested

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.