Issue with gun bullet direction

I want the bullet fire to be always aligned with the front of the gun

2 Likes

have you tried using Attachment?

1 Like

If you looked the recording then you can see that when i move the bullet is not aligned with the gun

1 Like

Well my bullet fire is a part will it work with attachment?

2 Likes

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

1 Like

You want teh gun to fire at Attachment spot?

Here is what i want

1 Like

Yeah sure!
Here teh instruction

This is where i create my bullet btw

Is Intersection where the Bullot
goes?

image

1 Like

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

1 Like

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

It still do the same thing
robloxapp-20211126-1431182.wmv (560.0 KB)

1 Like

In that case,you might wanna try using FasCast Redux

FastCast Documentasion
https://etithespir.it/FastCastAPIDocs/

FastCast DevForum thread

FastCast Redux Module
https://www.roblox.com/library/4453855787/FastCast-Redux

I don’t think it’s lag it’s just the bullet fire that take the old position and then don’t move

1 Like

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

1 Like