-
Change Y position based on Null’s rotation value
Hi
I’m trying to move a 3D object on its Y-axis as the value of a null object’s rotation changes. This is for a character rig that I’m busy with, so basically, as the null object is rotated on its X-axis (up/down), the object must have a slight offset and have a smooth movement. In this case the character’s eye. The null object rotates the body to tilt up and down and therefore the eye should follow realistically.
I have the following code which works, but the eye jumps from the one position to the next as the null reaches a certain value or goes above or below 0:
Expression code on the object’s rotation:
x = value[0];
y = 100;
z = value[2];if(thisComp.layer(“Face Rotation X”).transform.xRotation > 35 ) [x,y,z] else [x,-y,z]
if(thisComp.layer(“Face Rotation X”).transform.xRotation == 0 ) [x,0,z]I need the object to have a smooth position change and not jump as the null goes above or below 0.
Will appreciate any help in this regard.
Thanks
x = value[0];
y = 100;
z = value[2];if(thisComp.layer("Face Rotation X").transform.xRotation > 35 ) [x,y,z] else [x,-y,z]
if(thisComp.layer("Face Rotation X").transform.xRotation == 0 ) [x,0,z]