# completely relative LerpPosIntervals?

I tried to figure out how I am able to run a lerp interval that sets my model to a position relative to its previous one (eg. move Object to (node, 1,0,0 what moves the Object ‘node’ 1 unit into x direction - no matter what - and other running lerp intervalls (if Baked=0) will adept). The point is: I do not have a point I can use as reference, because I can’t determine if the model isn’t “in motion” by a other lerp interval at the time the lerp is going to be run…

So here is my question: Is there a way to move a model X units into Direction Y while Z other lerps/functions/whatever are moving the model?

Of course, I can let the model “jump” to any relative position, but is there a way to do that smoothly? LerpFunc can’t be used because it sends a character to a FIXED point - or if you want to have it relative, you can’t have another Lerp running at that time (that is moving the character along the same axis)

Thanks in advance

Regards, Bigfoot29

One thing you can use to your advantage is that if the target pos parameter of the Lerp is a function, it will be invoked when the lerp begins, and it should return the resulting pos. So you can do something like this:

i = LerpPosInterval(node, 5, pos = lambda node = node: node.getPos(node, Point3(1, 0, 0)), bakeInStart = 0)

And then, when the interval begins, it will determine its target position as (1, 0, 0) relative to its position right now, whatever it is, and then lerp to that position. The bakeInStart = 0 allows other lerps to affect its position in other ways (for instance, in the Y or Z axis) while this X lerp continues.

David

Im a little confused about the sentence you wrote there…

Not sure about this lambda… function (or whatever that is )… i would apreciate a lot if someone can give me more info regarding the usage of lambda and how does exactly work here…

thanks in advance…

diveintopython.org/power_of_intr … tions.html

explians python lambda functions.