Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Reload animations with multiple instantiated weapons

Discussion in 'Animation' started by Leobg, Oct 4, 2022.

  1. Leobg


    Oct 30, 2019
    Hi everyone!

    I am doing this post because I encounter a problem on how to animate several instantiated weapons while keeping the same base.
    I develop an FPS, so I have a prefab with FPS hands and each weapon is instantiated when used.
    As I have to animate the hands + each weapon, I don’t see what would be the best solution to do something efficient with, preferably, a single AnimatorController capable of managing all reload animations, even if the weapons are instantiated?

    I don’t know how else to do that other than by creating a prefab including the hands + the weapon, for each weapon but it’s clearly not the best solution :(

    Would it be better for me to set them in the prefab instead? And to activate only the selected weapon? Even though there are a lot of guns? I think it's a good solution but how can I manage all animations clips for each reload animation ?

    Thank you very much in advance for your help!
  2. Unrighteouss


    Apr 24, 2018
    I think making them all part of the prefab and enabling/disabling the guns you need is a good option. I'm no expert on optimization, but even dozens of disabled guns should be fine.

    If you want to instantiate the guns, know that instantiated objects aren't properly hooked up to their animations. Unity optimizes animations at runtime, and any missing objects won't be included in the calculations. You can use
    each time you instantiate a weapon to make its animations work: