Its kinda hard to explain it but this video will basically show it.
I’ve spent about 30 minutes just looking through this and I haven’t been able to find anything. This usually starts to happen when I start moving my character.
function LaserRenderer.createLaser(toolHandle, endPosition)
local startPosition = toolHandle.Position
local laserDistance = (startPosition - endPosition).Magnitude
local laserCFrame = CFrame.lookAt(startPosition, endPosition) * CFrame.new(0, 0, -laserDistance / 2)
local Attatch1 = Instance.new("Attachment", toolHandle.Parent.Parent.HumanoidRootPart)
Attatch1.Visible = true
Attatch1.WorldPosition = startPosition
local Attatch2 = Instance.new("Attachment", toolHandle.Parent.Parent.HumanoidRootPart)
Attatch2.Visible = true
Attatch2.WorldPosition = endPosition
local laserPart = game.ReplicatedStorage.BulletTrace:Clone()
laserPart.Parent = game.Workspace
Attatch1.Position = startPosition
Attatch2.Position = endPosition
laserPart.Attachment0 = Attatch1
laserPart.Attachment1 = Attatch2
print(Attatch2.Position)
local sparkeffect = game.ReplicatedStorage.EffectPart:Clone()
sparkeffect.Parent = game.Workspace
sparkeffect.Position = endPosition
-- Add laser beam to the Debris service to be removed & cleaned up
game.Debris:AddItem(laserPart, SHOT_DURATION)
game.Debris:AddItem(sparkeffect, HIT_FX_DURATION)
game.Debris:AddItem(Attatch1, SHOT_DURATION)
game.Debris:AddItem(Attatch2, SHOT_DURATION)
-- Play the weapon's shooting sound
local shootingSound = toolHandle:FindFirstChild("Activate")
if shootingSound then
shootingSound:Play()
end
end
return LaserRenderer
