I want the bullet fire to be always aligned with the front of the gun
have you tried using Attachment?
If you looked the recording then you can see that when i move the bullet is not aligned with the gun
Well my bullet fire is a part will it work with attachment?
Yes it will.
Raycasted bullet might be laggy.
I think it normal for it to be laggy tho.
Ok and how to i position the bullet with the attachment
You want teh gun to fire at Attachment spot?
Yeah sure!
Here teh instruction
Is Intersection where the Bullot
goes?
Insert a Attachment in the Handle.
Make a Variable of the Attachment
Exp:
local Attachment = script.Parent.Handle.Attacment
Ok i already put an attachment in it
Then.
local bulletClone = ServerStorage.Bullet:Clone()
bulletClone.Size = Vector3(0.2, 0.2, distance)
bulletClone.CFrame = CFrame.new(Attachment.WorldPostion, intersection) * CFrame.new(0, 0, -distance / 2 )
bulletClone.Parent = workspace
In that case,you might wanna try using FasCast Redux
FastCast Documentasion
https://etithespir.it/FastCastAPIDocs/
FastCast DevForum thread
FastCast Redux Module
I don’t think it’s lag it’s just the bullet fire that take the old position and then don’t move
I mean-
It really take the old place where it Activated.
Raycasted Bullet will follow the Attachment position but when moving it will still fire at old position for few milisecond
try using a midpoint: origin+direction/2