I’ve already got my projectile system set up and everything. But I still am trying to figure out how I can make a projectile ignore certain parts that can be “pierced” where the projectile essentially goes through.
I do not want to utilize raycast checks because these projectiles have travel speed.
I could make it so the parts that can be pierced have “CanTouch” set to false, but I would like the parts touched to have a hit reaction.
Currently, my projectile logic is:
ProjectileHitbox.Touched:Connect(function(hit)
if hitsomething then
hitsomething = false
-- logic for damaging humanoids and environment here...
if pierce <= 0 then
Projectile:Destroy()
elseif pierce >= 1 and hit.Name == "Pierce" or pierce >= 1 and hit.Anchored ~= true or intvalueexists.Value == 0 then
-- I'm not even sure I did the right checks because it doesn't work
-- "intvalueexists" is a check for environment props with HP
if modelfound then -- a check part of the logic
print("Hit model")
else
print("Hit part")
end
pierce -=1
hitsomething = true
end
end
end)
I could try to help, however I’m missing what isn’t working, like do you get any of your prints and have you tried printing the values in your very long pierce check? Also I’d recommend using an attribute like a boolean CanBePierced
Well since I can’t see about half the code, I’d recommend printing pierce, hit.Name, hit.Anchored, intvalueexists.Value
Then you can see what makes it decide it’s not going to pierce