How to set up animations for weapons?

Artalasky

New member
Hi, maybe this question has already been asked before, but it's hard enough for me to look for it in an almost unfamiliar language. I apologize in advance.

I have a First Person Controller and this pack of weapons, after several sleepless nights I understood how to add and configure a new weapon, but I still didn’t understand how to set up animations?

I understand that I need to configure the ANIMATOR on each weapon, but what parameters and transition values are needed?

P.S I added a weapon studying this tutorial.

Thanks in advance for your help.
 

Attachments

  • screen.JPG
    screen.JPG
    279.1 KB · Views: 42
I would start by duplicating the first person demo animator, and then removing all of the states from it. This will give you an animator with just the correct parameters. From there you can add your own states to it. There really isn't a defined structure that you have to follow - the demo animators are an example of what we found works best so you can follow something similar or if you have a method that works best for your game you can do that instead.
 
Thank you, I did it, replaced the animations with my own, inserted the desired value into "Slot0ItemID", but the animations do not work. Only IDLE animation works, transitions to other animations do not work .. I tried reloading and shooting, but the weapon is frozen in this stateю.

I tried to disable the parameters "Wait to Animation Event", after that the weapon stopped freezing, but the animation still did not play.
 

Attachments

  • 1.JPG
    1.JPG
    253.8 KB · Views: 39
  • 2.JPG
    2.JPG
    231.5 KB · Views: 32
Did you make sure to add all of the animation events? The easiest way to ensure you've setup all of the animation events is to check the original animation and see if there are any events added to it.
 
You were right, I did not add an event animation. But now I did it and ... nothing has changed. I can't even imagine what could be wrong.
 

Attachments

  • а1.JPG
    а1.JPG
    290 KB · Views: 24
  • а2.JPG
    а2.JPG
    285.1 KB · Views: 25
  • а3.JPG
    а3.JPG
    113.7 KB · Views: 29
I found the reason!
In the animator in the parameter Item0SlotID, there should have been a number from AnimatorID.
The problem was that I had an ID from the script First Person Base Object.

Initially, I had the correct ID, but apparently trying to solve my problem, I changed the ID. Now everything works!

It was also necessary to hang the script Child Animator Monitor

Thanks for the help, Justin.
 
Last edited:
Top