"Y cannot be assigned to" error

So. I’m trying to move a part upwards using a script. (Don’t worry. I know that loop is going to
make it go upwards forever.)
I think I should use Vector3 here but I’m not sure
Can someone help me, please?
I just need to know how can I make this script work properly.

5 Likes

Do you get any errors? Also this isn’t the best way to move a part upwards

lol I know this isn’t the best way.
Anyways, yeah I got an error like this

sdpsd

1 Like

Alright the problem is that Position.Y or Position.X or Position.Z is a read only property. You can change the Y doing:

Part.Position += Vector3.new(0, 100, 0)

11 Likes

It did work. Thank you so much.

Can i also do
Part.Position -= Vector3.new(0,100,0)
if i want to decrease Y?

yes. eeeeeeeeeeeeeeeeeeeeeeeeeee

Yes you can as you are still operating with a Vector3.

+= is just the shorthand for SomeVector3 = SomeVector3 + Vector3.new(X, Y, Z) as -= is the shorthand for subtraction.

for me the same error popped up

wouldnt a tween be easier? i’d reckon it would also be smoother

1 Like