In the vid when the mouse goes about 1000 studs away it phases through the part on the y axis, I have streaming enabled turned off and still don’t know what the problem is. Watch mouse pos phasing through? | Streamable
My mistake I didn’t see that it was turned off.
Video is bit unclear on exactly what went wrong but my guess would be that because of how far away it is, the distance makes it difficult to tell where exactly the players cursor is and thus results in them being detected somewhere else.
In the video when the airstrike indicator dissapears that shows the mouse going through the parts, it only happens at a certain distance
I now have an answer for you, turns out roblox has a lovely limit from mouse.hit.p
of 1,000 studs which is why at exactly such a time it clips through the Y axis. This was solved by someone in this post
I managed to fix it with the help of my brother
local function MousePOS(Ignore)
local MP = UserInputService:GetMouseLocation()
local RCast = workspace.CurrentCamera:ViewportPointToRay(MP.X, MP.Y)
local RaycastParam = RaycastParams.new()
RaycastParam.FilterDescendantsInstances = Ignore
local Result = workspace:Raycast(RCast.Origin, RCast.Direction * MAX_DISTANCE, RaycastParam)
if Result then
return Result.Position
else
return nil
end
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.