Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How i fix touched event glitching other parts ?

Whenever I use touched event this horrible bug ends up with my ideas, there is any way to arrange, avoid it or an alternative way without having to use touched to detect if something touched the moving block ?

The Annoying glitch : https://gyazo.com/e9fbc87ab02f9925ec43d0fbfbfb70eb

3 comments

2

Create a weld for the parts and connect it with the outer shell

1

^ agreed. Just weld the inside parts so when you move the outer shell the parts will stay in tact

0

Then that only heapen with cframed parts?

1 answer

This wouldn't be the fault of the Touched event, it's because the sphere and the larger cube aren't hollow.

My prescription: Collision filtering or hollowing out le stuffies with negation unions.

Example of collision filtering:

-- Use this in a regular script; might only work in ServerScriptService thou idk
local PhysicsService = game:GetService("PhysicsService")
 
local PhychicAttackGroup = "PhychicAttackGroup" -- rename this if you need to
 
PhysicsService:CreateCollisionGroup(PhychicAttackGroup) -- create the group for the thing
 
local PhychicSphere = game.Workspace.PsychicSphere -- or whatever
local PhychicCube1 = game.Workspace.PhychicCube1 -- or whatever
local PhychicCube2 = game.Workspace.PhychicCube2 -- or whatever
 
PhysicsService:SetPartCollisionGroup(PhychicSphere, PhychicAttackGroup) -- set the sphere's collision group
PhysicsService:SetPartCollisionGroup(PhychicCube1, PhychicAttackGroup) -- set the first cube's collision group
PhysicsService:SetPartCollisionGroup(PhychicCube2, PhychicAttackGroup) -- set the second cube's collision group
 
PhysicsService:CollisionGroupSetCollidable(PhychicAttackGroup, PhychicAttackGroup, false) -- should prevent the parts from colliding with eachother, but they'll still collide with players

2 comments

0

The issue is, connecting the Touched event to a part, even with empty function set as callback, makes it behave like if you were setting the Position of it - it moves it to the top of the other part, even if you set its CFrame. I've also experienced this bug so I can confirm.

0

Err... did you try collision filtering though?

This discussion is preserved as it was. New answers, comments, and votes are closed.