workspace:Raycast(...) sometimes returning void?

Hello

The script is as follows:

local mzl = tool.Muzzle.CFrame
local bulletCast = workspace:Raycast(mzl.p, (msp - mzl.p)) -- "msp" is Mouse.Hit

All script parameters have attached data, meaning the method should always in turn work - however it is to note that this method is being called ~12 times a second - the parent function is always called, but regularly bulletCast is void.

1 Like

It means nothing is hit

No shit.
The solved code is by adding increasing the length of the raycast.

(msp - mzl.p) * 300

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.