I want to have an object constrained to another object, whose parent is animated. I need a time offset to the animation too, so it's actually constrained to where it was/will be.
try/picture this:
- Get a poly sphere.
- Get a locator(1), and make it a child of the Sphere, and move it to the left of the sphere.
- Keyframe some rotations and translations on the sphere.
I need to get the delayed position of this locator1 (via an expression), but as it's parent is animated, we need some way to get the WORLD coordinates...
- Get a locator(2)
- constrain it (point) to the position of the first locator1.
Now I can get the world coordinates of locator2, and make my delayed expression from there...
First without the delay:
delayedObject.translateX=getAttr locator2.translateX
;
(same for y,z)
That works ok, now add the delay:
[b]
float $delay=5;
float $dTime = currentTime -q
-$delay;
delayedObject.translateX=getAttr -time $dTime locator2.translateX
;
(same for y,z)[/b]
Here the problem lies. Although delayedObject does exactly what is is supposed to, following locator2 with a 5 frame delay - but the SPHERE remains fixed!?!? As soon as you remove the "-time $dTime" from the expression, the Sphere once again performs its moves/rots.
Can anyone explain what is going on here, and how I can get around this problem? Or can someone suggest another way to make a delayed point constrain?
Thanks for listening!
Cybotic