Raycasting Issue

Hi everyone! I am a developer currently programming a placement system. However, I have run into some issues. When I place the object near another object, it marks it as hit however, when I hover over the object, it does not recognize it was hit. I know I am using a depreicated version of raycasting. lol

Thanks for any help!

local castRay = Ray.new(MouseTarget.Position, MouseTarget.CFrame.LookVector*100)
local ignoreList = {MouseTarget, SpawnArea, character, Baseplate,MouseTarget.BasePart}
local hit, position = workspace:FindPartOnRayWithIgnoreList(castRay, ignoreList)

MouseTarget is the object I want the ray to originate out of.

Switch to workspace:raycast or use Mouse.Hit like an absolute peasant

yes but I think the issue is the lookvector code near the end

Is there a video of the problem? From the code everything looks fine (assuming findpartonray is still working as intended)

On second thought you should probably just switch to new raycasting, it only takes like 30 seconds and will probably fix it and many future problems as well

Here is the video