Raycast hitting non existent part in a certain game

Hello,
I have an issue with my raycasts. In the test baseplate, the ray hits the correct things (baseplate, head etc), but in the main game, if we test the weapon the ray only hits “part” even when nothing named part is in sight. this is the same everywhere in the game, even when the place is empty.

I must add the gun operates perfectly in servers with other players on the taste place. The issue is only on this game.

The tool operates normally (See output for ray hit)

The tool is not working, see output. It is always hitting a “part” that dosen’t exist anywhere in the area.

image

local castParams = RaycastParams.new()
castParams.FilterType = Enum.RaycastFilterType.Blacklist
	local ignoreTable = {plr.Character, workspace.Areas}
	castParams.FilterDescendantsInstances = ignoreTable

local origin = script.Parent.Handle.Nuzzle.Position
	local direction = (pos - origin).Unit
	local res = workspace:Raycast(origin, direction*360,castParams)

Any help appreciated.

local origin = script.Parent.Handle.Nuzzle.Position

Is the Nuzzle an attachment? In that case you have to read the WorldPosition property instead of Position.

local origin = script.Parent.Handle.Nuzzle.WorldPosition

Thank you very much. This fixed it, I never thought about it - Stupid mistakes like this are the worst.

1 Like