Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

whats the best way to get my gun to look wherever the player is looking?

Asked by 4 years ago

I tried doing this, but im not exactly sure what to do exactly to get the gun to rotate to where the player is looking. I'm trying to get the gun to look up and down as well as side to side.

while wait() do
    local gun = script.Parent.gun
    local camera = workspace.CurrentCamera  
    local mouse = plr:GetMouse()
    gun.CFrame = CFrame.new(gun.CFrame.Position,mouse.Hit)
end

Answer this question