Answered

Export transform of melee weapon in hand as an animation?

Anonymous 4 years ago updated 4 years ago 2

Hi, 


I'm trying to make a simple first person game and I don't want visible arms but just a melee weapon in the camera view. I tried animating a 'swing' animation for the weapon but it doesn't look good. I have some motion capture animations of melee weapons being swung but I just want the transform position and rotation exporting in an animation for my weapon to move, so it looks natural? Maybe if I added an object to the hand bone of the animation, I could export that objects movement?

Is this possible? Thanks

UMotion Version:
Unity Version:
2019.2.2

Answer

Answer
Answered

Hi,
thank you very much for your support request.

The following could work:

  1. Create a script that copies the world space position/rotation of one transform to another (each frame). You can use this script to copy the mocap weapon transform to your weapon (that is not parented to anything).
  2. Then use Unity's animation recorder package to record that animation (you can get this via the package manager).

Another method (that would result in less key frames):

By using the "Sync" button in UMotion, you are able to synchronize the frame cursor of Unity's Animation Window (or Unity Timeline) with UMotion's frame cursor. So you could play the mocap animation using a Unity window, and use it as a reference to animate your first person melee weapon in UMotion. More information regarding the "Sync" feature can be found in the manual chapter "Unity Timeline Integration".

Please let me know in case you have any follow-up questions.

Best regards,
Peter

Answer
Answered

Hi,
thank you very much for your support request.

The following could work:

  1. Create a script that copies the world space position/rotation of one transform to another (each frame). You can use this script to copy the mocap weapon transform to your weapon (that is not parented to anything).
  2. Then use Unity's animation recorder package to record that animation (you can get this via the package manager).

Another method (that would result in less key frames):

By using the "Sync" button in UMotion, you are able to synchronize the frame cursor of Unity's Animation Window (or Unity Timeline) with UMotion's frame cursor. So you could play the mocap animation using a Unity window, and use it as a reference to animate your first person melee weapon in UMotion. More information regarding the "Sync" feature can be found in the manual chapter "Unity Timeline Integration".

Please let me know in case you have any follow-up questions.

Best regards,
Peter

Thanks, I'll try those suggestions