expression result must be of dimension 2 not 1 error
I'm trying to write an expression that determines the size of a path based on the width of two text layers.
However, I also don't want it to be less than 750 pixels wide. My first expression seems to work just fine, but when I try to use an if/else statement, I suddenly get an "expression result must be of dimension 2 not 1" error on my first line. What am I missing?
This expression seems to work:
var s = comp("Talent Name Precomp").layer("First Name");
var w = s.sourceRectAtTime().width;
var ss = comp("Talent Name Precomp").layer("Last Name");
var ww = ss.sourceRectAtTime().width;
[w+ww+80,0];
This one gives me an error:
var s = comp("Talent Name Precomp").layer("First Name");
var w = s.sourceRectAtTime().width;
var ss = comp("Talent Name Precomp").layer("Last Name");
var ww = ss.sourceRectAtTime().width;
if(w+ww+80<750){
750;
}else{
w+ww+80;
}