Issue with gun bullet direction

  1. What do you want to achieve?
    Hello, so in my game i have guns (it’s not a gun system from toolbox i scripted it)
    In my guns i have like a ray that goes where the bullet is shot but when i move it’s not positioned on the gun, i want the bullet to follow the gun movement.

In my gun tool there is a part this is what i reference for Shoot Part in the image.

  1. What is the issue?

  2. What solutions have you tried so far?
    Tried to fix it myself and looked on forums.

If you have any other questions about the gun for you need to help me, you can ask

1 Like

When you create/clone the projectile set its original CFrame to that of the barrel of the gun tool.

1 Like

image
Here ?

1 Like

This is the part where it supposed to get out of
image

And some others
image

1 Like

If you guys want a recording, here it is

robloxapp-20211126-1407434.wmv (1.0 MB)

2 Likes

You mean you want to make teh bullet fire at certain spot of the gun?

1 Like

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