I’m already using it.
Woodx I want to make a raycast using mouse position to detect whenever there is a part where the player clicks (I know there are easier ways to do this but I want to use the raycast)
Use the following for the mouse, I think this would be a improvent and it is also better to use this for other aspects:
local Players = game:GetService("Players")
local localPlayer = Players.LocalPLayer
local mouse = localPlayer:GetMouse()
mouse.Button1Down:Connect(function()
local mouseHitCFrame = mouse.Hit --Now use this for the raycast
end)
Also, if you want to cast the ray from the players head or hand or idk where, use this.
local origin = localPlr.Character.Head.Position
local direction = mouse.Hit
local rayParams = RaycastParams.new()
rayParams.FilterDescendantsInstances = {workspace.Baseplate, Player.Character}
rayParams.FilterType = Enum.RaycastFilterType.Blacklist
local result = game.Workspace:Raycast(origin, direction, rayParams)