Answered

Replace weapon in animation.

Sergio Razo 3 years ago updated by Peter - Soxware Developer 3 years ago 1

Hello. I been watching the videos of Umotion. I'm thinking on buy in it because of the special. But I need to know if there is a way to replace objects in a animation. Example: I have a FPS arms with shotgun. But I want to replace the shotgun with another model. Is there's a way I can do that with Umotion?

UMotion Version:
0
Unity Version:
2019.4.12f1

Answer

Answer
Answered

Hi Sergio,
thank you very much for your interest in UMotion.

The most optimal way would be to do this partly in animation and partly in scripting. You have one animation that holsters the current weapon, then a script (e.g. triggered via an animation event) that removes that weapon, spawns the new one and then triggers the gun pulling animation for the new gun.

If you want to solely do this with animations (without any scripting), you would have to place every gun as a child of the character and simply enable/disable the required one via the animation (a custom property can animate the guns GameObject.active property to show/hide the gun). While being simpler to make, this has small performance penalties due to the additional transforms of every gun in the hierarchy of your character. If you're not targeting low-end mobile device, this might not be an issue though.


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


Best regards,

Peter

Answer
Answered

Hi Sergio,
thank you very much for your interest in UMotion.

The most optimal way would be to do this partly in animation and partly in scripting. You have one animation that holsters the current weapon, then a script (e.g. triggered via an animation event) that removes that weapon, spawns the new one and then triggers the gun pulling animation for the new gun.

If you want to solely do this with animations (without any scripting), you would have to place every gun as a child of the character and simply enable/disable the required one via the animation (a custom property can animate the guns GameObject.active property to show/hide the gun). While being simpler to make, this has small performance penalties due to the additional transforms of every gun in the hierarchy of your character. If you're not targeting low-end mobile device, this might not be an issue though.


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


Best regards,

Peter