GuiCollisionService is an easy to use module that focuses on helping you create collidable Guis and help you detect them using BindableEvents. It is one of the easiest and efficient Gui Collision Detector out there. It helps you to create intuative 2 dimensional physics in your roblox games.
Thank you, Hope it helps you out, I would love to see the growth of 2 Dimensional games on roblox, and thats why I am bringing out a tutorial for making 2 dimensional roblox games pretty soon!
The example uses removeColliders whereas the definition above is removeCollider. Also I would suggest adding a way to remove collider based on instance using table.find
wait how are image guis possible?
does it detect the border or does it work with the images because I donāt see how it could do that with image detection
The module depends on the ImageLabel/Buttonās Size, unfortunately, Collision detections for images is not yet a feature, might be added soon if possible!
only thing I could think of is detecting which part of the GUI has color, other then that I donāt know how you could even do it, I donāt know too much about gui so idrk
I read over the source really quick it doesnāt seem to support AnchorPoint, not sure if that will affect usability of this Module but you should check that out.
Correct, as of now it does not support AnchorPoint. v1.17.0 will have these updates in it! I am working on these features currently, new updates will be released soon!
Tomorrow, I will be posting the tutorial about making your first GUI Based 2 dimensional game on Roblox! And this module will be included in the tutorial, so you can check that out as well for some more use cases of the module!
Added āsolidā property to :addCollider(), setting it to true makes it impossible for a hitter to go through a collider! Example:
local GuiCollisionService = require(game.ReplicatedStorage.GuiCollisionService)
local group = GuiCollisionService.createCollisionGroup()
group:addHitter(guiInstanceHitter)
group:addCollider(guiInstanceCollider, true) -- To make it impossible for a hitter to go through the collider
Special thanks to @RuizuKun_Dev without whom, this wouldnāt have been possible, after understanding the math, I was able to figure out how easy this was to implement!
I am working on a 2D RayCasting module to help you cast rays even when the rotation of the gui is not 0 for 2D projectiles. Stay tuned!
There are a few bugs to this, which I have been fixing, thanks!
Tweens will now be cancelled if the hitter touches a solid collider!
Added tweens parameter to :addHitter(instance, tweens) function! which cancels those tweens if the hitter touches a solid collider! View Docs
Added :updateHitter(index, instance, tweens) function which updates already existing Hitters, their instance and their tweens! View Docs
Added :getHitterTweens(index) which returns all the existing tweens of the hitter that are being played or havenāt been played yet. View Docs
:addHitter() and :updateHitter() function now return the hitter that was added which can be used as follows:
local addedHitter = group:addHitter(script.Parent.Hitter, { tween, tween2 })
addedHitter.index -- index of the hitter
addedHitter.instance -- the instance that was marked as the hitter, here: script.Parent.Hitter