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

Why does Raycasting get stuck sometimes?

Asked by 9 years ago

Occasionally, when I jump around and shoot into the air, a ray gets stuck. I don't have filtering enabled on, but as I was playing around with it with more people, my ray would get stuck in Workspace but no one else could see it, and vice versa. Why aren't ALL the rays being removed? Here's the script.

    local laser1, laser2 = laserPart:clone(), laserPart:clone()
    laser1.CFrame = orientation * cframe(0,0,-bulletLength*.75)
    laser1.Mesh.Scale = vector3(.12, .12 , bulletLength*.5)
    laser2.CFrame = orientation * cframe(0,0, -bulletLength*.25)
    laser2.Mesh.Scale = vector3(.08, .08, bulletLength*.5)  
    laser1.Parent = workspace 
    laser2.Parent = workspace
    debris:AddItem(laser2, .03)
    debris:AddItem(laser1, .06)

There seems to be no trouble when I'm pointing it AT an object. As of now, all I see is that it happens Sometimes when you shoot into the skybox. Why is that?

Thank you!

Answer this question