Detect if frame touches another frame

Hello developers,

I am currently working on a 2D tag game called Chaos, I have started to work on the tagging mechanic but am not sure how to go about it. I just need to see if the tagger frame touches a different player frame, then turn the player frame into the tagger frame. The process repeats. I have already tried the only 2D collisions library available (it sucks) and there’s really no info online about this. Thanks if you could help.

3 Likes

This is simply the consequence of trying to develop 2D games on an engine that’s designed to handle 3D processes. Roblox’s GUI systems weren’t built for creating full-scale 2D games and therefore do not provide the proper tools to do so.

The simple answer is don’t even try. Theoretically, you could achieve what you’re trying to make. GUIs provide enough functionality create a basic framework for 2D physics. But please, don’t do this. It’s not worth it. Designing a system of such complexity would take a very large amount of time, and would most likely be riddled with tons of bugs and overlooked errors. That’s not an insult toward you, it’s just that every legitimate framework that’s ever been developed has been worked on by teams of highly experienced developers over long periods of time.

Maybe instead of trying to use GUIs, perhaps you can use the physics engine and view things from a birds-eye view instead. It’s a much more plausible solution than dealing with GUI physics.

1 Like

Can you just detect the distance between the players and if the tagger is close enough, make the player they are close to the tagger?

You can make some real basic box collidiers which will check if two boxes are intersecting eachother or not. There are tons of ways to detect this from scratch through simple math formulas

Heres a really good channel and video that explains the theory on this sorta stuff really well.

And some other videos i have found too on the same topic

2 Likes

THIS is all you need: [v3.0] GuiCollisionService - Gui collisions done right

This would work and I have tried it. The only reason why I don’t use it is because it fires the collisions event like a thousand times a second. It’s a 2D game for christs sake, there shouldn’t be any performance issues.