It's a confusing question, I know, but I've tried to deal in raycasting (something Kenetic should add as a tag), and I've found that you can only fire at an existing brick and not the skybox, or else the script breaks. How do I do a workaround? I've tried just replacing the mouse.Hit.p with 999, but it was as if I had done nothing to it. It still broke after I shot at the skybox.
Here's my code:
function drawTrail (mag,position,ry)
local trail = Instance.new ('Part', Workspace);
trail.formFactor = Enum.FormFactor.Custom
if mouse.Hit.p ~= nil then
trail.Size = Vector3.new(0.1, 0.1, mag)
trail.CFrame = CFrame.new ((script.Parent.Handle.CFrame.p + mouse.Hit.p)/2, mouse.Hit.p)
else trail.Size = Vector3.new (.1,.1,999)
trail.CFrame = CFrame.new ((script.Parent.Handle.CFrame.p + Vector3.new (999,999,999))/2, Vector3.new (999,999,999))
end
trail.BrickColor = BrickColor.new ('Mid grey')
trail.Transparency = .5
trail.Anchored = true
trail.CanCollide = false
trail.TopSurface = Enum.SurfaceType.Smooth
trail.BottomSurface = Enum.SurfaceType.Smooth
for i = .5,1,.1 do
trail.Transparency = i
wait (.1)
end
game.Debris:AddItem (trail, .1)
end

1 comment
I was thinking of that, but hoping for a better solution. I know those bigshot clans never do that, so there must be a way! Thanks for the help, though. Appreciate it!