-
How to use length in if statement
Expression tells “undefined variable used in expression”
If there is not if statement,it works.
I used text source so that I make sure if length(s) was recognized.
Length(s) was recognised.I want to know what is wrong. thanks.
target=thisComp.layer("circle");
s = sub(target.transform.position,transform.position);
if(length(s)<=100){
lookAt(target.transform.position,transform.position);
}