How does this work?

Hey guys. So, as you probably know, .Touched events only work when the player touches the part, and it doesn’t actually register if the player is inside of the part. I’ve done some research to try and see how I could make a .Touched event register even if the player is inside of the part, and I’ve gotten some results. However, because the Dev Hub is well, the Dev Hub :roll_eyes:, this is the only thing I have.

local PhysicsService = game:GetService("PhysicsService")

local Metal = script.Parent.Metal
local Brick = script.Parent.Brick

local MetalCollisionGroup = "Metal CG"
local BrickCollisionGroup = "Brick CG"

PhysicsService:RegisterCollisionGroup(Metal)
PhysicsService:RegisterCollisionGroup(Brick)

Metal.CollisionGroup = MetalCollisionGroup
Brick.CollisionGroup = BrickCollisionGroup

PhysicsService:CollisionGroupSetCollidable(MetalCollisionGroup, BrickCollisionGroup, false)
print(PhysicsService:CollisionGroupsAreCollidable(MetalCollisionGroup, BrickCollisionGroup))

Yep. That’s literally it. Thanks a lot Dev Hub :confused:. I’ll be super grateful if you can help with this!
(I couldn’t find anything else, so if there are other things I can do, or that I am trying to use incorrectly, please let me know.)

Couldn’t you just use a spacial query like a Region3? That why you don’t have to do stuff like that.

You can also add another small part inside the part and detect it from there (depending on how small the part is, if it’s a big one then this method won’t work).

you could use GetPartsInPart() ?

im pretty sure their are a variety of more reliable functions that work kind of like .Touched

2 Likes

Region3’s methods are deprecated. @Soulx_xFlame mentioned, there are other things that are more reliable. I just don’t know how to use the other methods, because the dev hub isn’t much help. Anyways, thanks for trying to help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.