Hey Durgaprasad,
- When working with timelines you have to calculate ‘start point’ and ‘end point’ before entering the timeline. If you want to stop the time line mid way and change params and start again, you need to re-calculate the start and end point, AND start the TL from the beginning again.
A good habit when working with TLs is to put the bare minimum inside. I know it’s possible to put all sorts of things in there, but it will get to be a real hassle.
A much better way is only have the TL go from 0-1. Then, outside you can use a lerp, powered by the 0-1 to make the changes you want. This way, you can many components with one TL, just a different lerp for each component.
Also take a look at Ease nodes, they are a bit like lerps but configurable.
- General rule, work with a timeline OR work with interpto. They don’t mix.
If you’re using f/v/r/interpto, then you need tick, or getworlddeltaseconds. When working with tick, you use the current position and and destination on each tick, in contrast to TL above…
So, if you want to make a component move the many different locations, you can use either of the above methods. If it’s going to be random, once you’ve moved you just re-calculate the new destination.If it’s a specific number of places, put them in an array and use a loop to pick the targets out of the array, running the TL on each. Only change to the next array item once the TL has finished the current one.
- Don’t try it with a for loop. It’s very ugly. Up to you, but…