because you are using a range of shooting which is 50 and you divide by 2
and got a result in 25 then the range of the gun will be the same!
This is my solution
local origin = originPosition
so now you need a magnitude
local magnitude = (origin - hitpos).Magnitude
now u get a distance of a origin and a hitpart
then you can get a midpoint by doing a origin + magnitude/2 (or your midpoint thing)
When you blacklist something the Raycast will ignore it and go straight through it.
I suggest removing the RaycastParameters completely unless you want the Raycast to be able to “pierce” objects. In that case put the objects u want the Raycast to go through into the table.
I think I know the issue here. The problem is that the mouse’s position will identify where the ray cast does cast. The mouse is a 2d object so you would think it’s shooting it at the dummy but in reality it’s past the wall so the ray cast will be casted past the wall.