Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make it so when a gui object touches another gui object it does a function?

The title explains it all, but if you want more detail, like pong. When the ball hits one of the paddles, the ball will flip. Does anyone know how I can do this in Roblox?

2 answers

✓ Accepted answer

You can check their positions, a touched event for GUIs doesn't exist.

1 comment

0

Okay, thank you.

What you need is 2D collision detection (SAT) which Roblox doesn't provide but luckily for you it's so easy to understand and implement.

Try finding your own sources but here are two for now: https://learnopengl.com/In-Practice/2D-Game/Collisions/Collision-detection

And of course, our fav developer (or at least mine lol): www.youtube.com/watch?v=IELWpIGtjRg

Hope this helped and good luck :D

6 comments

0

This doesn't work anymore, do you have a link to up to date video?

0

wdym? The link is up to date. I will update it so it's clickable

0

I believe it's also called AABB. so if you want to find the sources you prefer

0

No, the script doesn't work.

0

did you just copy the whole thing from the video? You are supposed to understand how you do it and then you will very easily be able to. I think it should work though

0

I did, it didn't work.

This discussion is preserved as it was. New answers, comments, and votes are closed.