BillboardGui following behind attachment

Hey!
Currently i’m working on a laser attachment for my game.

I am running into an issue where the billboard gui at the end of the laser is lagging behind.
No performance issues, nothing but just plain delay.

here is a video.

Originally i had just put the billboard gui inside of the attachment, but afterward tried to set it as an adornee.

Here is the code:

stepped:connect(function()
	local result = workspace:Raycast(part.Position, part.CFrame.LookVector * 500)
	if result then
		at1.WorldPosition = Vector3.new(result.Position.X, result.Position.Y, result.Position.Z)
		bgui.Adornee = at1 -- setting billboard gui adornee.
	else
		at1.Position = at2.CFrame.LookVector*500
	end
end)

Here is a screenshot of the explorer:
image

If you could explain why this is and potentially share code to fix this i would be eternally grateful.
thanks.

3 Likes

I’ve had this issue before with lasers as well. From what I see, your game uses a ViewModel, what I’d do is to set the position of the attachment after the ViewModel has been updated.

hi, just saw this
i ended up using a particle emitter instead. Works better and has a nicer result