Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you check if a button is moving to left or right?

Asked by
SuperPuiu 497 Moderation Voter
2 years ago
Edited 2 years ago

Weird question, I know. I'm working on a plugin that has a moving ImageButton (randomized one) and I want to flip it based on the direction it moves. Is here any property that would help me, or an article? Some links would be really helpful!

Oh, and so far I tried that:

local x2 = x - script.Parent.ImageButton.Size.X.OffSet

if x2 < 0.5 then
       print("Right")
       else
       print("Left")
end

Thanks for reading!

Answer this question