Help with Raycasting Through Accessories

Hi!

I am making a gun system, and have a small issue with raycasting for bullets

You see, when I fire a ray and it hits an accessory, it will damage the player. This makes for an unfair advantage to players with less accessories. Naturally, I wanted to avoid this, so I made the ray do no damage when it hits an accessory. Now, hair and hats make it impossible to get a headshot because the rays dont do damage when they hit them. How do I make a ray go THROUGH the accessories instead of hitting them?

I could loop through every player and their accessories (add them to ray blacklist), but that’s super inefficient. I looked at other posts, but found no answers.

thoughts?

Check this out.

1 Like

I meant without making a list of everyone’s hats

Honestly, I can’t think of any other way than this.

I don’t believe there is another way of doing that without blacklisting the object you don’t want to be counted.

An alternative would be checking whether the accessory belongs to a player.

1 Like