Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How i fix touched event glitching other parts ?

Asked by 6 years ago

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

2
Create a weld for the parts and connect it with the outer shell hellmatic 1523 — 6y
1
^ agreed. Just weld the inside parts so when you move the outer shell the parts will stay in tact awesomeipod 607 — 6y
0
Then that only heapen with cframed parts? Rodrigo2003 76 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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
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. Amiaa16 3227 — 6y
0
Err... did you try collision filtering though? sweetkid01 176 — 6y
Ad

Answer this question