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

How do you make spread and bulletdrop on a raycast?

Asked by 5 years ago
Edited 5 years ago

Do any of you know how to make the ray cast by a gun go randomly within a "cone of fire" (like this http://www.chuckhawks.com/where_spread2.jpg) as well as angle down a degree or two to simulate bullet drop?

whatI have so far

local ray = Ray.new(head.CFrame.p,(mouse.Hit.p - head.CFrame.p).unit * range
local part,position,normal = game.Workspace:FindPartOnRay(ray,player.Character,false,true)

Answer this question