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

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

Asked by
harstud 218 Moderation Voter
4 years ago

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

Log in to vote
0
Answered by 4 years ago

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

0
Okay, thank you. harstud 218 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

0
This doesn't work anymore, do you have a link to up to date video? harstud 218 — 4y
0
wdym? The link is up to date. I will update it so it's clickable GGRBXLuaGG 417 — 4y
0
I believe it's also called AABB. so if you want to find the sources you prefer GGRBXLuaGG 417 — 4y
0
No, the script doesn't work. harstud 218 — 4y
View all comments (2 more)
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 GGRBXLuaGG 417 — 4y
0
I did, it didn't work. harstud 218 — 4y

Answer this question