[v3.0] GuiCollisionService - Gui collisions done right

Thank you! It works, for the most part, the part now changes to green when it touches any of those parts, but also a Frame called Background gets affected, the whole thing moves with the cursor.
image

image

May this be the reason for that behavior? (script.Parent)

1 Like

Nope, I had it before, but I tried removing it but it the Background still moves with the cursor for some reason, I don’t really have any codes that does anything with the cursor

Edit: I SOMEHOW didn’t notice that in the code O_O, sorry!
The code works perfectly fine after removing that part of the code.

Thank you so much for helping me, your code is amazing!
Have an awesome day/night!

Is there a way to get the normal of the hit gui? If not, it should very well be a feature in a newer update.

1 Like

How can i detect which hitters that hits the collider?

How do I use this?! I’m just trying to detect which GUI a certain GUI is touching then return the touched GUI but my studio crashed using this module!

Same, it was also a huge pain in the butt to setup. It fires like ten times a frame when they are touching lol.

1 Like

I had to resort on a different function to utilize it anyway, the module does not like it when a frame gets destroyed with the event.

I’m getting ReplicatedStorage.Modules.GuiCollisionService:120: attempt to index nil with 'x' when I try to do if GUICollision.isInCore(ItemBox, script.Parent.Inventory) then

Awesome Module, except its a bit inaccurate.

Heres a video showing it, theres a beep sound when the red square in the player collides with a bullet.

Would like it to be fixed.

1 Like

Yeah, me too! How could I fix it @jaipack17?

I was trying to figure out why the OnCollisionEnded event kept firing more and more times while the game was running and came across this code here. It’s creating a new listener event every frame and firing them all at once when the GUI exits another frame.

image
necropost but I wanted to put this out there for anyone who comes across this in the future

This module has a VERY difficult time when destroying the colliders. It’s kind of a fatal flaw, the module does not work. When I :Destroy() an object, I expect the collider to stop working. Even when I destroy the collider using the method given, it breaks other colliders because my colliders are being created and destroyed pretty rapidly.

thank you so much bro. you are a life saver

Just wondering if there’s a way to detect which collider has been touched.

Hi, I am trying to make the collisions work, but for some reason when the player walks right next to specific colliders, the ‘Colliding’ value turns to true and the player just gets stuck there… Here’s what I mean (when I walk past the cave, it works as intended, but when I walk past the house next to it, the bug occurs):

I can’t come up with any solutions, is there anything I could do to fix this?

EDIT: I noticed that it usually only happens if i’m walking next to a collider on the collider’s left side

im pretty sure you need to change the ZIndex of the guis, heres the update jaipack17 made for the specific issue you are facing

.isInCore() does not seem to work, it just says
“ReplicatedStorage.GuiCollisionService:119: attempt to index nil with ‘x’”

here’s the code

	local instance1 = script.Parent -- example
	local instance2 = script.Parent.Parent.Parent.Inventory -- example [Frame]

	service.isInCore(instance1, instance2)
1 Like

so from looking at the code i realised how you can do it yourself

local function insidebox(object1,object2)
	if service.isColliding(object1.topleft,object2) and service.isColliding(object1.topright,object2) and service.isColliding(object1.bottomleft,object2) and service.isColliding(object1.bottomright,object2) then
		return true
	else
		return  false
	end
end

add frames and name them into corner names and put them at the corners

I have an error i cant fix, the thing is if you rotate an object and use “IsColliding()” it still has the old collision i cant get rid of

		local colliding = false
		-- touching other objects?
		for i,v in ipairs(script.Parent.Parent:GetChildren()) do
			if v ~= script.Parent then
				if service.isColliding(script.Parent,v) then
					colliding = true
					print(v)
					break
				end
			end
		end