So I'm trying to change the parts Y Value by adding 15 to it but it throws an error saying that it can't be assigned to how would I fix this or how would I accomplish what i'm doing another way?
this is the line of code that i'm dealing with
NewPart.Position.Y = NewPart.Position.Y + 14
Yes, it is read-only, so you can't edit it directly. It's pretty easy to do what you want, though. All you need to do is set the position like normal, with Vector3.new
. Now we can use the x/y/z properties, and it won't matter that they are read-only, since Vector3.new
takes three numbers anyways.
part.Position = Vector3.new( part.Position.X, part.Position.Y + 14, part.Position.Z )
As Spongocardo pointed out, it would probably be better to simply add a Vector3 to the current position, like so;
part.Position = part.Position + Vector3.new(0, 14, 0)
I apologize for overlooking this originally...