Animating different Weapons

Hello, I am making a 3D Survival game. but I am having a few difficulties with the weapon system. I have already made a Database for items such as my weapons and what im trying to do is to make different animations for each weapon I have. Now I just have a hand object with an Animator and a weapon on it. I heard about layers, but it’s not going to work for me, because I need to save the animations in the Item database.

Hi Darkhalo45,

  • If you have different animations for different weapons built into hand objects, you can select which animation plays with which weapon, easily triggered by Animator Controller. That can be easily saved to database.

  • However, if you don’t have animations and actually creating animations with animation timeline, then you are creating different animations for different weapons, and again, you can trigger them easily by Animator Controller.

  • If you don’t have any animation for your weapons, nothing (even Layer system) will work out of box for you. You have to have animations.

  • Animator Controller is great, and you can trigger any animation based on any weapon you want. Here are some nice official tutorials on Animation Controller:

Take a look at the timeline system, its the new animation system that superceeds mecanim and will allow you to do animations for each weapon (including how the enemy reacts to the hit if you want) in an intuitive visual way, and then knit those “blocks” of gameplay and animation together using 1 line code calls.

Check out Timeline - Unity Learn for more information!