-
Missing a moving target
Have a bow and arrow and a moving target(wiggle). The bow and arrow follow the target with this expression on rotation:
shoot = thisLayer.index;
dx = thisComp.layer("heart").transform.position[0]
- transform.position[0];
dy = thisComp.layer("heart").transform.position[1]
- transform.position[1];
radians = Math.atan2(dy,dx);
follow = radiansToDegrees(radians);
if (time < shoot) follow else thisComp.layer("cupid").transform.rotation.valueAtTime(shoot)To the arrow's position I've added:
shootStart = thisLayer.index;
shootFinish =thisLayer.index+1
start = transform.position;
finish =thisComp.layer("heart").transform.position.valueAtTime(shootStart)
linear(time,shootStart,shootFinish,start,finish)My arrow shoots at the target and heads to the point where the target was correctly, but it stops when it gets there. I would like it to follow the same trajectory but extend past that point. Ideally the total distance travelled would always be the same(keeping the velocity the same). I'm planning to shoot the target multiple times, hence the indexing-once I get one arrow to do this right.
Johnny Cuevas, Editor
http://www.ckandco.net