Why does the ray on my ray cast gun collide with my fake view model gun?

What it looks like: https://gyazo.com/c086a7c35d726ef873ab660de4023ef8

For some reason, when I aim down sight, the rays reflect and bounce upward, but when I fire, it’s perfectly fine. What’s causing this and what’s a valid solution to this?

It looks like the ray is hitting your player, which is obviously something you don’t want. Are you using FindPartOnrayWithIgnoreList? You can use this to ignore the character, as well as anything else you wish to ignore.

local ray = Ray.new(origin, direction)
local hitPart, hitPosition = workspace:FindPartOnRayWithIgnoreList(ray, {player.Character})
1 Like

Yeah, I’m pretty sure I’m using that. Here’s the snippet of code of what the ignore list looks like:

Huh, that’s weird. It looks like you have all your bases covered. Try printing the hitpart to see if you’re getting anything unwanted.

You are not ignoring the player’s character when casting, because that script won’t ever pick up player parts as they both collide and are not transparent

1 Like