Trying to make .touched event constantly fire

Hello, I am trying to make a system that checks for another part. The checker follows the player and is non-collidable, so it can’t collide into the part. The problem is that the event only fires once, and I need it to continuously fire as long as it is touching the other part:

Code:

local hitbox = script.Parent

hitbox.Touched:Connect(function(hit)
	print(hit.Name)
end)

hitbox.TouchEnded:Connect(function()
	print("touch ended")
end)
2 Likes

You can use either Region3 (Tutorial) or WorldRoot:GetPartsInPart()

2 Likes

This should fire whenever the hitbox is touching something as long as the CanTouch property is enabled or am I missing something? :thinking:

It fires as soon as an object touches the hitbox but then it wont fire unless the object is moving on the hitbox.

It’s like car wheels on a road? The road being the hitbox?

да, as long as the car is moving it will detect its moving but as soon as it stops no more detection. And at that moment TouchEnded would fire.

2 Likes

image
The red is the hitbox where it should detect if you place a piece of dirt. The problem is that it only detects once when you place the dirt. Sorry for not being clear…