For some reason, Explosion.Hit event is not working. This was working at one point then stopped. The problem occurs in both Studio and the live server. I have also read Roblox’s API documents and I don’t see any problems with my code. It just seems that the event does not fire at all since the print statements are not being executed. The explosions, however, works fine.
Here is a video showing the problem. WARNING Turn down your volume. It’s LOUD.
Here’s the code in question:
Grenade Projectile Script
-- Explosion hit logic.
hitConnect = explosion.Hit:Connect(function(hit, distance)
print("Explosion Hit", hit, distance)
local params = {
blastPos = explosion.Position;
radius = projEffects.explosion.radius;
distance = distance;
}
weaponsMod.processHitAoE(player, hit, playerTable, params, toolData, toolInstance)
end)
Rocket Projectile Script
-- Explosion hit logic.
hitConnect = explosion.Hit:Connect(function(hit, distance)
print("Explosion Hit", hit, distance)
local vector = (hit.Position - explosion.Position)
local params = {
position = explosion.Position;
radius = projEffects.explosion.radius;
vector = vector;
distance = distance;
}
weaponsMod.processHitAoE(player, hit, playerTable, params, toolData, toolInstance)
end)
I have also read the following articles here on the developer forums:
https://devforum.roblox.com/t/explosionhit-not-producing-any-output/636229
https://devforum.roblox.com/t/why-doesnt-explosion-work/1641698
https://devforum.roblox.com/t/explosion-hit-isnt-working/1903882
The second article mentions that Explosion.Hit will not fire if the hit part is not a descendant of a humanoid model. However, as you can see in the video. I’m hitting a humanoid (an NPC to be specific), and then I went and stepped on a grenade to set it off.
Any ideas as to why this isn’t working?