I made some blocks that give players a boost using the .Touched event. But it is not reliable(for example, I can walk on blocks and it doesn’t give me any effects). Is there any other way?
(I don’t want to use Region3 cause there are a lot of blocks.)
It uses a combination of Region3 and Raycasting to check when a player enters a ‘zone’.
Simply do:
local touchParts = your.group.of.blocks
local zone = Zone.new(touchParts)
zone.playerAdded:Connect(function(player)
-- give boost
end)
zone.playerRemoving:Connect(function(player)
-- remove boost
end)
zone:initLoop()
You can use .Magnitude, the distance in studs between 2 objects, or :GetToucingParts(), which returns an array on the parts that intersect with the part.