- Home /
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.
Answer by TanselAltinel · Nov 09, 2017 at 12:11 PM
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:
https://unity3d.com/learn/tutorials/topics/animation/animator-controller
https://unity3d.com/learn/tutorials/projects/2d-roguelike-tutorial/player-animator-controller
This system is currently being deprecated, as mentioned in numerous unity official forum threads, so probably best to suggest the newer system ins$$anonymous$$d.
Answer by Daemonhahn · Nov 09, 2017 at 12:20 PM
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 https://unity3d.com/learn/tutorials/topics/animation/using-timeline-overview for more information!
Your answer
Follow this Question
Related Questions
Door animation bugs and stays open unity 3D 0 Answers
How to reset gameObject position when switched back to? 0 Answers
How to have an animation loop only twice 1 Answer
Efficient way to instantiate a sprite that plays an animation then destroys itself? (3d space) 1 Answer
Jumping into Animation : Is Unity Animator worth to learn ? 1 Answer