You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Raycast a cone shape which can have a variable width
What is the issue? Include screenshots / videos if possible!
I am unable to do so with my current understanding of raycasts
--angle can vary anywhere between 5 and 50
local RayDirection = Vector3.new(Random.new():NextNumber(-angle, angle), Random.new():NextNumber(-angle, angle), Random.new():NextNumber(-angle, angle))
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
local RayPosition = caster
local beam = Tool.Pistol.Part.Beam
local final = script.PointCount
local beamea = Tool.Pistol.Part.BeamEndAttachment
local angle = Player.PlayerGui.ScreenGui.Frame.angle.angle.Value
local RayDirection = RandomCone(caster.CFrame.LookVector, math.rad(45))
warn("RayDirection Set")
local Params = RaycastParams.new()
Params.CollisionGroup = "Default"
Params.FilterType = Enum.RaycastFilterType.Blacklist
Params.FilterDescendantsInstances = {RayPosition}
local Result = workspace:Raycast(RayPosition.Position, RayDirection, Params)