Hey guys. I've been trying to make a script that subtracts the position by .1 and the size by .2, so that it looks like sliding glass. This is my loop:
Shield = script.Parent
while script.Parent.Size.Y > 0.2 do
Shield.Size.Y = Shield.Size.Y - .2
Shield.CFrame.Y = Shield.CFrame.Y - .1
wait(.05)
end
script.Parent.CanCollide = false
The error it throws is as follows:
Y cannot be assigned to Script 'Workspace.Shield.Script', Line 4
Thanks in advance,
Aurum

1 comment
The individual parts of a Vector3 are read-only; you need to modify the entire thing. The answer given by ipiano should should work.