I’m trying to fire lasers from the ‘muzzle’ of a gun viewmodel. The issue is the attachment seems to be slowly moving down, while still following the viewmodel:
In the video I’m just clicking to add more beams to the workspace, where the beam attaches to the muzzle attachment position. As you can see the beam is created in a slightly lower position every time, while still following the model on all axes, even the vertical one. moving the camera up also moves the attachment up, but it remains offset. Printing the position of the attachment shows it slowly moving downward, so that’s definitely where the issue lies.
the attachment is attached to the viewmodel like so, it’s parented to the meshpart.
Attachments can’t “move” on their own, so this is either a visual-physics problem (the gun might not be anchored) or a script is changing the Position of it
No, attachments have their own use. Start your deep dive into constraints and you’ll see. However, here, you’re setting the part’s CFrame every frame to the camera. Physics still apply on it since its unanchored, and that’s unwanted behavior