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

Help with Ray Casting Gun Spread?

Asked by
BielNS 40
5 years ago

A little help Plz? This is part of my script

--//Ray

local ray = Ray.new(Firehole.CFrame.p,(mousehit.p - Firehole.CFrame.p).unit * Range.Value)

local ignore = chr

local part,position,normal = game.Workspace:FindPartOnRay(ray,ignore,false,true)

--//Calculate

local distance = (Firehole.CFrame.p - position).magnitude

--//Bullet Size

bullet.Size = Vector3.new(0.05,0.05,distance)

bullet.CFrame = CFrame.new(Firehole.CFrame.p, position) * CFrame.new(0,0,-distance / 2)

This is part of my script wich makes the ray, how do i make a spread for that?

Answer this question