So I'm writing a script involving the changing of the Orientation property/ The problem is it's multiple parts, all with different Z orientations that I don't want to mess with - I only want to change the Y. Can I change just the y part of the property without interfering with x and z? If so, how?
Thanks.
In order to change only one axis of rotation without affecting the other axes, you can add the original vector with a new one. For example, the following would increase only the y
axis of the vector by five:
local vector = part.Orientation vector = vector + Vector3.new(0 , 5 , 0) part.Orientation = vector
Adding vectors is just adding the individual components of the vector operands. For example, Vector3.new(1,2,3) + Vector3.new(4,5,6)
would equal Vector3.new(1+4 , 2+5 , 6+3)
.
just type .y after the thing...
example:
part.position.Orientation.y = #