Jump to content

Animation Loop problem


photo

Recommended Posts

Hello Everybody,

I recently tried to import my animated tank tracks from blender. The animation works by moving the threads to the position of the following one. After that, they should jump back to their starting position again. The problem is however, that the threads do not "teleport" from end to start position (like they do in blender, where i created the animation), but rather move rapidly to the beginning again. Especially on low speeds, you can see it clearly. I could not find any post relating to this specific post. Does anyone know how to deal with this?

Thank you for your time.

Link to comment

Ignore the last animation frame, then you don't get blend between last and first frame of animation, when you set time to animation.

		int numFrames = mesh.get()->getNumAnimationFrames(animId);
		// ignore last frame from number of animation frames
		if (time > (numFrames - 1))
		{
			// ignore last frame
			// when mesh is returning to start position
			time = time - numFrames + 1;
		}
		mesh.get()->setFrame(layer, time);

 

Edited by honya
Link to comment

eoailg

In order to make it work inside the Editor I guess you need to do a full 360 degrees circle animation, so it will start to loop correctly without any code. Otherwise, you can follow the previous advice from @honya and implement your custom animation play logic.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...