-
Issue with animated parents
Hey there, I’m working on writing an expression to animate parents between layers and I have an issue I’m not understanding.
Scenario:
Two layers, child and a parent. My expression is going into the position value of the child. Child has a check box and a layer control drop down.Issue:
with my current code (pasted below), things are working well, but I have one small issue. I can animate the code to work when its checked on, but once I do that, the child snaps to the position of the parent, wherever it happens to be, instead of moving with the parent regardless of where it initially started. I’m guessing I have to calculate the position at the current time for the parent or something, but not sure how to go about doing that.I’m sure this has been posted before, so if its easier to direct me to a previous thread, please do. Thanks!
myParent = effect("Layer Control")("Layer");
myProp = myParent.transform.position;
boole = effect("Checkbox Control")("Checkbox");if(boole==1){
value + (myProp.value - myProp.valueAtTime(0));
}else{
value;
}