Gun bullet not shooting correctly

Hi im a newbie roblox developer, and im working on a survival game.
i wanted to make my own gun, but i have issue on it.

i’ve made the gun model and added gun script on it by watching youtube, but i have issue.
the gun bullet raycstacing thing doesn’t came out from the gun’s muzzle, but instead it shoot from the ground where i put the bullet model.

image
image
/ \ in the youtube video, im supposed to place the Bullet on server storage and Shoot in front of the gun’s muzzle in the gun tool. as you can see the Shoot part is in front of the gun’s muzzle.


/ \ the tool’s Script
\ / and tool’s LocalScript
image

\ / result

i cannot find the solution from the devforum, and i have no idea how to fix it.
if you know how to fix this, please respond/help!

1 Like

You should make the origin part visible just to make sure that it’s actually attached to the gun

1 Like

origin part is which part did you mean?

1 Like

The origin as in the part where the raycast is starting.
image

1 Like

sorry, i still doesn’t understand how to do it (im such a dummy).
please explain it to me

1 Like

he means you should confirm that the shoot part is properly welded to the handle, you can quickly check by making the shoot part visible temporarily and seeing if it correctly follows the tool or if it just stays where it is where you put it

2 Likes

set the transparency of this part
Screenshot_2024-09-05-12-42-56-18_cbf47468f7ecfbd8ebcc46bf9cc626da
to 0 and play test to make sure that the part is still on the gun. I suspect this might be the issue because the code should work. Alternativly you can replace this part with an Attachment and use the property WorldPosition instead of position

1 Like

i think, i forgot to weld that part…

1 Like

Is everything welded properly? is anything anchored at all?

1 Like

i just forgot to weld the shoot part, dummy me. thanks everyone for helping

1 Like