Kill Brick Sensitivity

Hey! I’m creating an obby type game with user made obbies and rounds, and I have a little problem . . .

The kill script in the parts aren’t as sensitive as they need to be; hence, players can hold down jump and not get killed by the bricks, anyway to fix this?

local Brick = script.Parent

local function PlayerTouched(Part)
	local Parent = Part.Parent
	if game.Players:GetPlayerFromCharacter(Parent) then
		Parent.Humanoid.Health = 0
	end
end

Brick.Touched:connect(PlayerTouched)
5 Likes

Not entirely sure why this wouldn’t work but maybe try this instead.

script.Parent.Touched:Connect(function(hit)
 if game.Players:FindFirstChild(hit.Parent.Name) then
  hit.Parent.Humanoid:TakeDamage(math.huge)
 end
end)

Also have to mention that :connect() without a capital C is outdated,
use :Connect() instead.

It’s not it doesn’t work it’s just delayed

Try making the kill bricks .CanCollide false. This works pretty well.

1 Like

Is that a Floor?
Is a Floor u should turn off CanCollide and Clone it but Turn on it and make it Smaller.

3 Likes

This is typically a problem with R15 hitboxes. What you can try is creating a brick below the HumanoidRootPart that serves as a “touch detector” of sorts. Instead of checking if the player touches a brick, check if this detector touches a kill brick. If so, kill the player.

12 Likes

You could try welding a invisible part to the character, and create a bigger hitbox. It is mainly the animation.

4 Likes

I’m preety sure this would work:

local noob = script.Parent 
noob.Touched:Connect(function(lol)
if lol.Parent:FindFirstChild("Humanoid") then
lol.Parent.Humanoid.Health = 0
end
end)

and again, it works. it’s just DELAYED

I’m pretty sure he’s saying that the killbrick works, its just that its DeLAyEd since the R15 Character has a different hitbox causing some problems. To fix this, you would most likely have to change the hitbox. @colbert2677 suggested a nice idea which is to attach a brick to the HumanoidRootPart Below and using that to detect touches instead. As @REALTimothy0812 also mentioned, the animation also plays the part of making this annoying. If you want though, you could try changing the jump and fall animation but that would be unreliable in some cases since it could still happen.

A more easy way too is to make the killbrick cancolide off. That way, the character goes into the killbrick effectivley killing it. If that doesnt work, you can try extending an invisible killbrick up a little more with cancolide off but I don’t recommend this since it could make it really weird.

Have you read or tried my solution? Looks like you just breezed over it.

Attach a weld part under the root and use this to check for touch detections. Relying on the R15 hitbox will give you the delayed issue you’re facing and animations may cause users to die, which in turn also equates to bad UX (users will complain about dying unreasonably).


@3rdhoan123 Setting the CanCollide of a brick to false won’t change the delay effect necessarily, the hitboxes still serve as an issue. Changing the size of bricks also may not fit with what OP wants.

10 Likes

It works perfectly for me. It might be related to your game’s performance.

1 Like

Whether or not there really is a delaying issue, you should look into @colbert2677’s advice. I just did a test of my own, and on an empty baseplate (aside from two kill blocks) I experience an issue with R15 where I can repeatedly jump on both of the blocks. One block is a standard kill block, the other one uses the Touched event of humanoids.

You will either need to restrict your game to R6 only, or do what colbert said.

1 Like

If it’s working but delayed it’s not a matter of sensitivity, but latency. You could handle it (at least partially) locally if you want lower latency (since there would be no network communication to initiate the death).