Shotgun weapon animation

I looked at the demo scene, but I couldn't figure out where the animation was, how would I set up my shotgun to work like the demo?
 
Take a look at this page:


So the shotgun has an item id of 3. From here I recommend going through this video to get an idea of how the animator is setup:

 
So I've got the animator set to the right ID, and I see that in the demo scene the shotgun item gains a animator, which moves the cocker or "action" and various other pieces when firing / reloading. How do I set up my shotgun to populate with an animator that works with the FPS arms animator?
 
I've watched the video but it doesn't really explain how I could animate an item to work with the main animator.
 
So I've dove deeper into the animator, what I can't understand is. In the demo scene, when the shotgun equips it has a separate animator controller than the character controller, but if I add a animator component to my item (runtime pickup) when picked up it doesn't have the animator. So my question is, how do I animate my shotgun so when you pick it up at runtime it has the animator component attached.
 
I can see that in the demo the animator is added to the item inside the "items" parent. Where do I add the animator with a runtime pickup?
 
You'd add the Animator to the item object prefab - in the demo scene, the Bow is an example of a runtime pickup item that you can use as reference for a lot of stuff, e.g. the Bow prefab has two child objects, for first and third person, each of which has its own Animator component.
 
Hey All :)

Although following tutorials, I hope well, I also found myself here...
Still relatively new / not up-to-speed, so, expected I imagine.

Anywho, The Shotgun setup isn't as straight forward as the rifle example via documentation (I probably missed something). Following the same steps as when creating the rifle and being sure to apply the correct animation ID (3) to the shotgun I'm able to equip & fire it. Though without animations and when running out of ammo the weapon becomes locked and no longer able to dry fire, cycle weapons, or do really anything really but move character around after this.

To fix, I copied demo Nolan into working scene. Then copied his shotguns item 'Shootable Weapons' script settings as closely as I could. Noticing my 'Shootable Weapons' script was different for 2 settings - ''use complete event' and 'reload event'. After matching these settings with demo Nolan's shotty mine now works as expected. BTW there are SEVERAL other settings that are different via demo shotty & tutorial setups. I also figured out how to make random noises and learned of a handful of other settings while deconstructing the demo's shotgun...So worth the time for sure.

I'm only wondering what else I may be overlooking during this learning curve :/

Q - In a nutshell, Why do I need to alter those settings for the shotgun but not the rifle? (or maybe I do, I haven't compared rifle settings yet...)
Q - How would I know I need to alter them?

> I've simply copied what you guys have done within the demo, but don't really know why or what I've done...
> The rifle's settings are unchanged in these areas (defaults via item creation), Considering the settings changed to match my created shotgun with Nolans demo shotgun, I assume the shotty not working out of the box is due to animations & timing events that must be accounted for in which the rifle doesn't need adjusted. So we're accounting for that with the 'use complete event' & 'reload event' settings? <--- basically, IDK what I'm doing. I just buy stuff and pray it works... Also this seems like a really silly question I feel like I've answered myself on already, but well...'ey 2020 ;)

There are SO many settings it becomes quickly confusing and hard to manage - I assume in time this will be overwhelmingly simple....just not there yet.

Anyway, sorry for the book.
 
I think some parts of some of the tutorial videos might be a little outdated now, so unfortunately there may be a few discrepancies here and there between them and the demo scene - so that's likely where you're seeing a difference in those weapon properties that you've changed.

A simple explanation of what those settings do: the "use complete" and "reload" events are events that UCC executes at the relevant times. Animations will often send animation events at specific moments in the animation (you can view an animation's events by opening it in the inspector and clicking "Edit", there's an "Events" section near the bottom), and if you have "Wait For Animation Event" enabled, UCC will listen for a certain animation event name (e.g. "OnAnimatorItemUseComplete" for the "use complete" event) before firing that event. If you don't have "Wait For Animation Event" enabled, you can instead simply have UCC fire its event after a specific amount of time. Each approach has its uses based on the type of animations/animator.
 
Excellent!! Many thanks Andrew, super helpful with the animator info...
I'm finding the "Events" area you mentioned but not seeing an edit button, though honestly this is my first experience with animations...I'll take a sec to get up to speed here cause yeah this is all a very new area. That all makes a lot of sense though, so thank you!

~there goes the rest of 2020 ;p
 
Yeah I also have the same issue for the shotgun. I can understand it's complicated, and I have a 2 barrel shotgun with 2 bullets and he must reload inserting 2 bullets with a completely different shotgun and animation... Dear God to time the events....
 
Animations i will nail. The problem is to get the weapon to work with the same setup as demo shotgun. But with only 2 bullets.. it freeze, can't reload, can't shoot, can't change weapon
 
Have you followed the links/steps suggested in this thread so far? If you're having a separate issue (which it sounds like you are if the item can't even be used), please create a new thread and we'll be happy to help.
 
Yes I have followed the steps now .. I copied the settings from the demo shotgun .
If I have shells in inventory and pickup the shotgun, all shells I have is loaded, my shotgun have capacity of 8, but if I have 19 shells when I pickup the shotgun, all are loaded. If I have none, and pickup the shotgun, and pickup shells he starts loading shells and never stop and the shell count are displaying 0 . Same thing if I shoot up all those 19 shells, and pickup more, he starts reloading and never stops.
 
Sorry guys, It works. It didnts save all my changes to my runtime prefab for some reason. It works now! Thanks for reading my nagging :D
 
Top