Spherecast Wall Collision Issue

Hi.

Could someone tell me why the spherecast is going through the wall and how to prevent it? It appears to not respect the collision once the origin is at the center of the sphere radius.

local RunService = game:GetService('RunService')

local CastVisuals = require(script.CastVisuals)
local SpherecastVisualiser = CastVisuals.new(Color3.new(0, 1, 0))

local function castSphere()
	local origin = workspace.Zombie
	local target = workspace.Target
	
	local raycastResult = SpherecastVisualiser:SphereCast(origin.Position, 4, target.Position-origin.Position)

	if raycastResult then
		warn(raycastResult.Instance)
	end
end

RunService.PreSimulation:Connect(castSphere)
1 Like

Bump! I posted this late at night.