I am making a gun, but Nothing happen, when I try to make a Ray from the gun to the mouse.Target
local head = game.Workspace[game.Players.LocalPlayer.Name].Head.CFrame.lookVector
local mmouse = CFrame.new(game.Workspace[game.Players.LocalPlayer.Name].Head.Position,mouse.Hit.p).lookVector
difference = (head-mmouse)
local ray = Ray.new(weapon.Shoot.CFrame.p, (mouse.Hit.p - weapon.Shoot.CFrame.p).unit * 300)
Is that because Ray casting doesn't work in LocalScripots? Or I missed something?

2 comments
Does the same thing. No error codes, but i can't see the ray. Or shall I see it?
You have to create a part go to the link to learn how