How to make this animation


I am new to jmonkey and I making some test with blender animation and jmonkey.

My goal is to design a turret (to make a tower defense game). The turret will have an idle animation (turning left to right).

I played a little with the ogre exported but my sample tower is made of 3 meshes : a cube and 2 cylinders, and I was only able to export 1 mesh not the 3…

then when the turret has an enemy in range it should stop the idle animation and rotate it self toward the enemy, how could I make this second animation (is it possible to create a dynamic animation like rotate of X°). I can rotate the object from jmonkey but it will rotate the whole object not only a part of it.

Could you give me advice on the bests ways to achieve this ?

thanks for help !

If your turret consists of 3 meshes that are not connected by their polygons, simply export the 3 parts apart and add them to a node that keeps all 3 meshes, that way one mesh can be animated through code, alowing it to turn and face the target easily. It’s just a matter of turning the top-object separately :wink:

If the turning part consists of multiple meshes, I’d suggest adding them together to a node, and adding this node in turn to the bottom node, allowing you to place the turret by moving the bottom node, while allowing the top part to turn using the top node.

1 Like