Touched event firing when it isn't touching

The “lilpart” part on the hammer, that is supposed to collide with the black cylinder, is saying the wheel is touching it constantly, even if it’s not.

Hammer Script:

local lilpart = script.Parent.Hammer.lilpart

lilpart.Touched:Connect(function()
	script.Parent.HingeConstraint.MotorMaxTorque = 100000
end)

lilpart.TouchEnded:Connect(function()
	script.Parent.HingeConstraint.MotorMaxTorque = 0
end)

ssa

The collision geometry of these two mechanisms might not match their visual appearance. Enable Show Decomposition Geometry in Studio’s settings to see the actual collision models and adjust the parts’ CollisionFidelity to find the most accurate representation that you intend for these parts to use.

1 Like

Both parts CollisionFidelity are already set to PreciseConvexDecomposition.

It’s because it is literally touching, roblox collisions can end up bigger than supposed to. Just add a check in the touched event

1 Like

Have you tried placing your object in the air, touching nothing else??

1 Like

Could you show where this wheel is in relation to the “lilpart”? Is there a duplicate wheel? Are the physics and touch handlers done on different sides of the server-client boundary? Are you allowing network ownership of these parts to clients or have you restricted ownership only to the server?

1 Like

Everything around it has CanTouch disabled.

Only “lilpart” and the Wheel have it enabled.

image

GetTouchingParts is a spatial query, like a raycast or GetPartsInPart. Whether or not a part is considered in a query is controlled by CanQuery, not CanTouch. CanTouch does affect Touched and TouchEnded events though. CanQuery can only be disabled if the part has CanCollide disabled. This disc that the “lilpart” is attached to must have its collisions, touch, and query properties disabled so GetTouchingParts matches what the Touched and TouchEnded events indicate. GetTouchingParts is likely just showing the wheel that the “lilpart” is stuck onto.

I think there’s a misunderstanding, this is “lilpart”:
thisislilpart

Can you add a print to the Touched handler that says the full path of whatever it hit? It says you’re changing the torque when that piece is touched, can you confirm that torque change is happening, unintended or not?

image

The torque change does happen. (The .Touched event)

What are the scale of these parts? If the gap between them is too small, the engine might be fudging the collisions for performance.

The gap is close for the pointy part on the wheel to touch the “lilpart”

What kind of check? Elaborate?