#Gui Scripting this eyeball thing

1 messages · Page 1 of 1 (latest)

abstract vessel
#

i want this red pupil to stay within the eye ball and follow the players mouse, but I don't have much experience in gui scripting so I need some pointers 🙏

kind linden
#

firstly is the pupil a seperate image to the eye

abstract vessel
kind linden
#

ok good umm id have to think about this lol

main pewter
#

All you need to do now is get the percentage of where the cursor is relative to the screen. For example...

If the cursor is at pixel 960,540 (center of the screen), thats 50% of the total width and height, now, just plug that into the eye's range. What's 50% (middle) of 50,50 and 100,100? 75,75. The eye should be at pixel 75,75

abstract vessel
kind linden
#

My stupid dumb way would be to put a bunch of invisible buttons and 'button.MouseEnter:Connect them to tween the eye into the direction of the buttons but i wouldn't do that

main pewter
abstract vessel
#

im mostly a game systems scripter, gui is hard cuz there is so much more math and numbers it seems (depending on what you're doing i guess)

#

i was thinking, what if i can make it follow the mouse but have it bound inside the primate of the image below it (the eye), that might just be what you were saying but in a smarter way 😭

main pewter
#

Yep youre basically halfway to what im trying to say lol

#

But instead of following the mouse by having it directly under it, you get the percentage of where it is in the screen and map it to the eye and its location in the eye socket

abstract vessel
#

hmm okok lemme go play around with it for a moment, thanks kyu and alex :D

abstract vessel
warm plover
abstract vessel
#

i think kyu mentioned something like that, needing to get the size of the screen 🤔