Why are none of my parts touching?

I am using :GetTouchingParts() to create a spreading fire effect but am running into a problem where none of my parts are actually colliding with each other.

https://gyazo.com/26c0d4e9071bf1b960ab8e8e826374a6
Above is the desired outcome, the fire starts in the grey part(Had to individually move each part with collisions on for it to work.)

https://gyazo.com/12a49fd9d60436cdc58101b2ee39f7e9
However, above is what happens when I build normally and with collisions on. Roblox does not recognize the parts as touching and therefore the fire does not spread.

My question is, how can I build so that Roblox recognizes all my parts are touching each other without making sure each individual part is colliding correctly. I built this with 1 Stud movement and duplicated the original part when needing a new part.

3 Likes

Whenever I try to put two parts together using collision, it is not touching each other 100% of the time. Have you checked if the parts are actually together?

If not, try my way of putting parts together:

  1. Use the ResizeAlign plugin
  2. Select the sides you want to connect to each other
  3. If you are concerned about the size, scale the opposite side of the block using .01 movement until you get the size you want.
1 Like

I’ve encountered this problem before, and i can say from experience that @Mack_ii his steps seem like the most reasonable way of doing it.
Give his steps a try and if they don’t work try this

Now i tried and selected JoinSurfaces.

See if JoinSurfaces works

If you’re using getTouchingParts(), I don’t believe that parts merely ‘touching’ each others’ surfaces is enough. They need to be intersecting (CORRECT ME IF I AM WRONG!). I’d rather use rays, or just compare parts with it is surrounding to decide whether it should get caught on fire.

Edit:

I actually went ahead and checked whether I was right about GetTouchingParts(), it turns I was right. Parts need to be intersecting, not ‘touching’ by gracing their faces.


If you pay attention to the output, you can see that it says 0, there are no touching parts.

1 Like

Do you know of any other methods I could use to find the touching parts? I know you mentioned rays and comparing parts but i’m not sure how I would go about using those for this, if you could maybe explain a way I could use it (don’t expect you to write out any code for me).

It might be better to use Region3. Have it detect parts within a region3 of the parts size + Vector3.new(1,1,1). This will give you a half stud gap to work with which will allow parts that aren’t touching but are reasonably close to set aflame. The only downsize is that this may not work as well with some things like Unions and other part types.

This has been done numerous times before, the most popular solution is duplicating a part (an invisible one that acts as a hitbox )and make it bigger and then use GetTouchingParts(). I believe it was @Zairky that came up with this (or at least presented it in a devForum post) that I’ve read before. //Sorry about the ping if it wasn’t you.

You basically just need two functions.

Function A) createBiggerHitbox
//This is supposed to take the part you need and simply making it a bit bigger.
so like

local function bigHitbox(part)
local newPart = part:Clone()
newPart.Parent = parent
newPart.Size = part.Size + Vector3.new(0.2,0.2,0.2)
newPart.CFrame = part.CFrame
return newPart
end

and then I trust that you’re capable of making a getTouching function.

local function GetTouching(object)
local bigboiHitbox = bigHitbox(object)

-- code for the touching function

return touchingParts
end

2 Likes

Appreciate the help :slight_smile:
https://gyazo.com/072390f520d347cde165238841bb833f

2 Likes

I’m honoured you remembered! I originally used this method for coin placement haha.

3 Likes

@Ukendio

Hi, I understand that the method you proposed is a way to do it.

But just out of curiosity, why do you have to make the part bigger than the actual part?

It seems like a very hacky way of doing it and Roblox should fix that!

No, the thing is that the getTouching method only interact with intersecting parts, and that is a good thing :slight_smile: They should however implement a method to check touching surfaces :oo

1 Like

Oh that’s right!
Yeah, hopefully they add getTouchingSurfaces!

(Maybe someone can make a post about it?!)

2 Likes