I am making an enemy that will end the game whenever it touches the character or the campfire. I detect when it touches the campfire with a simple part for a hitbox.
It detects when it touches the player just fine, but it just phases through the campfire hitbox it doesn’t even trigger the event (I’ve tried with print())
Here is a video, the hitbox is the red, slightly transparent box surrounding the campfire and the enemy is the glowing white sphere.
You may also notice that nothing is shown in the output, as you can see in the script, I have the hit’s name and parent printed when the touched event is fired.
-- follower is the enemy, which is just a sphere with stuff in it
follower.Touched:Connect(function(hit)
print(hit.Name, hit.Parent) -- this doesn't print anything when it touches the hitbox
local endgame = require(game.ServerScriptService.EndGameModule) -- this is the endgame function
if game.Players:GetPlayerFromCharacter(hit.Parent) then
endgame.Endgame()
end
if hit.Name == "FireBox" and hit.Parent == game.Workspace.Campfire then
endgame.Endgame()
end
end)