Help with sending mouse position from client to server

Im trying to make a gun with raycasting but I cant figure out getting the mouse position. How can I make this work?


You can pass the Vector3 position of the mouse in the :FireServer() call, and then reference it through the Remote Event handler, for instance:

-- // Client
remoteEvent:FireServer(mouse.Hit.Position)

-- // Server
function OnServerEvent(player, mousePosition) -->> Remember that the first argument is the player.
    
end
1 Like