Attachment position seems to change without actually moving

Hi, I’m trying to just spawn a part at an attachment’s position but every time I do it, it seems that the position of the attachment lowers in the Y direction but its actual position isn’t changing in-game. I’ve made the attachment visible so you can see what I’m talking about. You can see the attachment’s world position changing in the console every time I click.


The script just instantiates a new part and sets its properties. There is nothing in the code that even remotely touches the attachment other than accessing its position here. I’ve tried doing it in a normal script instead but still the same thing occurs. I’m completely lost on this so appreciate any help thanks.

local function fire(target)
	warn(gun.Main.FirePoint.WorldPosition)
	
	local b = Instance.new("Part")
	b.Size = Vector3.new(0.1, 0.1, 1)
	b.BrickColor = BrickColor.new("Br. yellowish orange")
	b.Material = Enum.Material.Neon
	b.CanCollide = false
	b.CastShadow = false
	b.Anchored = true
	b.CFrame = gun.Main.FirePoint.WorldCFrame
	b.Parent = workspace.Debris

	local m = Instance.new("SpecialMesh")
	m.MeshType = Enum.MeshType.Sphere
	m.Parent = b
end

Not sure why this is happening, but if no fix is found, consider using a part instead as the barrel/shoot point, which is what I do, and it seems to be quite efficient, unless you’d rather not.

Make sure to anchor your viewmodel

Here are a list of three other post with people having the same problem with the recommended solution being to anchor the viewmodel.

3 Likes

Thank you, that fixed it for me

Is anchoring the primary part only ok???