Copy link to clipboard
Copied
Hi I need some help with this expression, I keep getting an error saying expression must be a result of dimension 2 not 1.
This is the current expression
x = transform.position[1];// current location of object x axis
y = transform.position[1];// current location of object in y axis
x1 = 1 ;
Y1 = 1 ;
cb = effect("1-1")("Checkbox") ;
if (cb ==1) {
{x1,Y1};
} else {[x,y];}
Copy link to clipboard
Copied
You have defined both x and y as the y value of position in the first two lines.
The if statement has x1 and Y1 in {} and they should be in [];
If I wanted the checkbox to move the layer from its current X, Y position to 1, 1 this is how I would write it.
cb = effect("1-1")("Checkbox");
if (cb == 1) {
[1, 1];
}
else {
position;
}
If you want to define variables for everything I would write it like this:
pos = position;
x1 = 1 ;
y1 = 1 ;
cb = effect("1-1")("Checkbox");
if (cb == 1) {
[x1, y1];
}
else{
position;
}