Z cannnot be assinged to error

Hello!

I am currently running into an error while trying to position a part
“Z cannot be assigned to”
I am not sure whats going on, here is my code

if realBullet:IsA("Part") then
	print("its a part")
	realBullet.Parent = hitPart
	print("parent ".. tostring(realBullet.Parent))
	realBullet.Parent.Part.Size.Z = hitPart.Size.Z * 2 -- this is where the error is coming from
else
	warn("its not a part")
end

To change just one component of a vector you can do something like this:

realBullet.Parent.Part.Size = realBullet.Parent.Part.Size * Vector3.new(1, 1, 0) + Vector3.new(0, 0, hitPart.Size.Z * 2)
1 Like