So i’ve been workin on this game and this is supposed to be an expanding killbrick, however when the player is standing completely still it doesn’t do any damage, just goes right trough them (Its can collide false)
As you can see its a very simple script and if the player touches it while jumping or walks into it works just fine, the only issue is if the player stands still
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.Health = humanoid.Health-255
end
end)
Here’s the code, any help would be greatly appreciated.
You may want to look into GetPartsInPart to detect the hitbox better. I’ve seen other posts in here as well where people got help dealing with exactly what you’re dealing with. Just use the forums Search using the word GetPartsInPart.
i wouldnt recommend using touched events unless your making something simple like a kill brick. instead, loop through all of the parts touching the instance with :GetTouchingParts. this will return a table then you can just table.find the part/instance you are looking for. good luck!