Roblox 2D Collision detection!

Look at what ive created! I make 2D screenGui Collision detection system

You can download the items I created right here:
https://www.roblox.com/library/6344303493/2D-Collision-Detection-Items

A demo of my system:
https://www.roblox.com/games/6241812936/Pac-Man-2D-Demo

Sadly enough my collision detection does not yet work when the item is rotated. so please keep that in mind

27 Likes

Wow, that is really cool! I do agree with you, you should definitely create a maze/pac-man sort of game

1 Like

Some other guy posted the same thing about 1 hour earlier. A real coincidence I’d say.

Im also using AABB collision bounding boxed. So pretty cool that people are thinking about 2D stuff

2 Likes

Yes I do agree, I rarely see any 2-d types of games. So seeing them on the front page would be pretty amazing!

1 Like

This can be really useful for UI effects, for example the old Windows XP screen saver or many other things.

1 Like

There are probably some out there, but ive never really seen them.

It would be pretty fun to create a 2D style game!

Though I doubt that roblox would create any 2D game support in thier system.

Yea Man Totally! you would be able to detect the collision and send it back into a different direction.

Ive put a link in my original post that sends you to a download page for the items

1 Like

2D games, here we come! …Veeryyy sloooooowllyyy…

1 Like

Oui oui baby, lets go and make some 2D games!

Hey dude there is something called SAT it worked for rotated objects you should search it up :grinning:

1 Like

Are there any benchmarking’s of the system? Arent your checking for collisions with every object? If that’s true then it wouldn’t scale well…

Well ive tested it untill about 50 collision boxes, I saw bearly any increase of CPU ms and even Ram usage my normal CPU ms is about 15.5 average or something like that. After adding the collision it was around about 16 on average.

I don’t have a base benchmark, but on my machine i have 340 average so it is not really that demanding.
The calculations for checking if something is inside of the bounding box is just AABB collision detection which is very simple and consists of just 4 conitions and that is it. I am also only calculating the pushout amount if the collision was actually detected and if the object itself is “Static”

1 Like

I have found a few 2D games being made at the moment I randomly found personally in a random way but it’s not there at the front page yet, so I think you may be right :PP

1 Like

Also nice, that’s cool that you made this because no one I saw has done that before.

1 Like

One guy actually posted 1 Hour before my showing his very own system. So there actually are multiple options out there. But im not sure if he publically posted the scripts

1 Like

Honestly, if you put it in community-resources this could get more attention since it seriously deserves it.

1 Like

This Is amazing. Do you know If there Is a way to add gravity to a gui? (lol Im late to this)

Yeah very cool i did something similar for my game even thos its not a gui game… The real difficulty is when the character is travelling at very high speeds or collides at extreme acute/obtuse angles…

1 Like

you add gravity by just adding a negative gravity force to the vertical movement speed every frame the character isnt colliding with the ground

gravity = -0.2

if character is not grounded then
verticleMoveSpeed = verticleMoveSpeed + gravity

2 Likes

I was taken back from developing a 2D fighting game before, but this is very well done, good job.

1 Like