Need help with making a ripple effect on this button. I have the entire ripple effect itself complete, I just need help with positioning it. For those who want to just say "get the players mouse x and y, ezpz" or something like that, let me give a demonstration. Let's say I click the button at (394, 190). On the image provided, that's the position of the red square. Now, the red square is parented to the screengui itself, which means it is relative to the screen's size. However, let's look at the green button. The green button is at the EXACT SAME POSITION - (394, 190). But since it is parented to the button, the position is relative to the button. So what I'm asking is -- how can I basically make sure the red button stays in place when I parent it to the button instead of making the position relative to the button's size?

Provided Picture: https://goo.gl/n6lNYs

Code that handles the position:

button.MouseButton1Down:Connect(function(x, y)
	local x1 = ??
	local y1 = ??
	local bind = coroutine.create(ripple.create)
	coroutine.resume(bind, template, activeRipples, speed, transparency, x1, y1)
end)

1 comment

0

just get the button's position relative to screengui and the red button's position relative to screengui. Then subtract the red button's position from the button this way even if you parent the red button to the button the position remains the same.