Basically I made a gun system which shoots lasers (a projectile with a trail, so a part and the trail follows it.) I basically did this and I was just wondering why The projectile shows so late and if theres anyway I could fix this because it is becoming an issue to me now. Here’s what it looks like:
https://gyazo.com/8886ac9c8c2c32831b3e90afca39def9
local function onLengthChanged(cast, lastPoint, direction, length, velocity, bullet)
if bullet then
local bulletLength = bullet.Size.Z/1
local offset = CFrame.new(0, 0, -(length - bulletLength))
bullet.CFrame = CFrame.lookAt(lastPoint, lastPoint + direction):ToWorldSpace(offset)
end
end
Do I need to change anything in this code?