if your tank is separated in layers, then:
1. create the animation of the tank using keyframes, start and end keyframes should be accordingly. you should go 1 frame back from your end keyframe and trim the comp. this is your tank moving wheels precomp and if you play thatin a loop - it will seamlessly loop.
2. place it in your master comp and in the master comp set time remapping for the precomp. go one frame before the last and set a keyframe, and delete the last keyframe.
3. set an expression for the time remapping:
4. extend your precomp - now it will seamlessly loop. you can move position now in the master comp.
*there are advanced expressions that enable you to move the tank and the wheels would rotate as you move it automatically but this requires a particular setup.
**here's an interesting setup for a car rotating wheels according to position. maybe this will help:
thanks for the replay but i'm looking for something like i can wrap my layer around the custom path and then rotate it along the path
like google "bend object along curve maya "
if it's 2d and on flat surface and it's a tank, how much warping is involved if any? how about orient along path? is it not good enough? it won't bend or warp but it will move along the path and rotate accordingly.
with a bit more work it can look like this:
you should also look in this thread that a user asked for assistance with a bike chain animation Help with mask path. in the thread there was the option of using plugin called Newton: Newton 2 - aescripts + aeplugins - aescripts.com
and if the design could be limited to vectors, you could do with the text path animator with something like this:
there is this youtube series by the talented EJ Hassenfratz - Bend layers along path. maybe it could help you:
if it's something else, please provide a screenshot or two showing the actual element and the problem, so we can offer something else based on your scenario. a good reference for the type of animation you are looking for will also be helpful.
I have a way to do this that I don't have time to explain any more than to say that the top and bottom tracks are cut where they make contact with the drive wheels. Their speed is controlled by an expression that measures the movement along a vector. You can choose the layer that represents the ground so that moving the ground or moving the track results in the correct movement of the top and bottom sections of track. The top and bottom track sections run on a loop that is only as long as the time it takes for one link to travel over it's dimension so you can stretch the out point of the track layers to any length and the movement of the tracks will always appear to be correct.
The wheels have tracks linked and their rotation is also based on the movement of the wheel or the ground layer. The links are masked in such a way that they make a seamless joint with the top and bottom parts of the tracks.
In addition to position, scale is also taken into account so you you scale the track or the ground layers the movement is always correct.
The position of the front and back wheel is controlled by the length of the track segments. The length of the track segments is controlled by the length of a single link so that all of the links always line up perfectly.
I'm not giving you this explanation to try an get you to try and recreate the expressions on your own, I'm just demonstrating what is possible when you understand expression language. This kind of animation is always easier when it is driven by expressions or scripts. The formulas used are all just basic geometry. The top and bottom track movement is assigned with a single animate preset that uses index - 1 to move the top copy of the layer the opposite direction as the bottom one. The wheel expression is also divided into two parts to that the length of the top and bottom portions of the track are always positioned properly.