Forum

User posts Yau Bitter
06 March 2018 13:10
If i add a parent it acts the same way:

If i animate the parent one time it starts from its starting position but when i start the animation for a second time it begins from its original position again and does not stay on the last x,y,z it ended after animation. And its child follow him.

If i animate the child it happens the same: it always begin from its starting point after i restart anim. Do i have to change behaviour? I defined AB_FINISH_STOP. Or maybe i have to move manually the parent after animation has finished?
05 March 2018 15:29
Hello. I'm quite new in b4w and want to know how to change position (using JS) after animation is done. I explain my actual scenario so you can identify the problem:

A 1 frame timeline with no actions assigned to objects so they stay stopped on begin.
In my scene there are 10 boxes each called BLOCK001, BLOCK002 and so on (they all have active dynamic geometry and can be moved via code).
An action called "jump" with activated [F] so datablock is saved even with no active uses.
On javascript i have set up the anim and called it using:

m_animation.apply(target_object,"jump");
m_animation.play(target_object,callback_after_jumping);

function callback_after_jumping(object_to_move) {
	m_trans.move_local(object_to_move, 2, 0, 0);
}


I want it to move 2 units through the X axis after finishing animation, but it seems to reset position to 0,0,0 each time i play the animation so it always begins at it initial position. How can i make it animate, update starting position, and animate again starting from that new coordinates?