I am developing a simple shooter game, but the only thing I am having difficulties with is getting the CFrame of the mouse on a surface.
Any assistance would be very helpful!
I am developing a simple shooter game, but the only thing I am having difficulties with is getting the CFrame of the mouse on a surface.
Any assistance would be very helpful!
You can use;
i think idk i don't use mouse stuff a lot
local Mouse = game.Players.LocalPlayer:GetMouse()
--Make sure you update this position each time you run it
local function update()
if Mouse.Hit then
local MousePosition = Mouse.Hit.Position
end
end
--janky way to update it until you find a better way to run the code
while game:GetService("RunService").RenderStepped:wait() do
update()
end
Let me know if this helps, you can also use this for more information;
This discussion is preserved as it was. New answers, comments, and votes are closed.