Why does FE Gun kit / Raycasting not detect or hit parts that have transparency = 1

Hello,
I have a need for weapon bullets to hit parts where the part has transparency set to 1.

The problem is all weapon systems I have tried out ( FE or ones that use raycasting) shoot through the part. I have notice that if the part transparency is set to .8 or higher, the bullets go through it.

Does anyone have an idea why and how I can fix it so that they hit parts that have a transparency set to 1?
Thanks for any information.

2 Likes

I don’t have experience with this kit but I’m guessing this is in place to ensure that if you have invisible parts the bullet doesn’t just stop mid air for no reason.

One way to fix this issue would be to use a script to detect when a bullet hits the part and then apply some kind of damage or other effect to the part or to the object that fired the bullet. You could do this using the Touched event on the part and checking the Name property of the object that touched it to see if it is a bullet.

Here is an example of how you could use a script to detect when a bullet hits a part and apply damage to the part:


function onTouched(otherPart)
    if otherPart.Name == "Bullet" then
        -- Apply damage to the part
    end
end

part.Touched:Connect(onTouched)

I hope this helps! Let me know if you have any questions.

Hi, thanks for the info.
I was trying to not use onTouched, because they say it is not totally reliable / good. Thus looking into raycast or a FE gun kit, but then hit this issue.

I was hoping someone with Raycasting knowledge might know why.

This is an example of a FE gun kit, shooting through a part that has transparency set to .8

image

In both the"ProjectileHandler" and “FastCastRedux” modules you want to find the line where it says “hitPart.Transparency > 0.75”.

Now do what you want in the lines, they are responsible for what is blacklisted.

open Find all / replace all, and type “transparency.”

1 Like

From this, you may be able to find a statement that checks the transparency of the part it makes contact with.

1 Like