Trying to Add the Sniper and Shotgun to Deathmatch AI. AI doesn't hold correctly or fire

Jroo

New member
Hi so I managed to figure out how to add all the same kinds of weapons from the deathmatch ai kit to my ai (the pistol, assault rifle, and rocket launcher). I figured I could do the same thing with the other ultimate character controller weapons. I tried to do this with the Sniper Rifle and Shotgun but neither or them work, and the ai does the same thing as you can see below:

Sniper AI:

Shotgun AI:

I'm not really sure what's wrong. I've followed the same exact process as the other weapons. The weapons have the appropriate animators on them. I used the animator slot 0 ID of the sniper as 5, and shotgun 3. I made sure their transform values matched correctly. The AI has the weapon and ammo in the inventory, default loadout, and as an available weapon in the DeathMatch Agent component.

The only warning I get says the weapon can't be fired cause the look sensitivity, but I figure that's expected because the weapon never points in the direction they would shoot at.

Is there anything I'm missing that I have to do to add a new weapon to the Deathmatch AI? I do realize it's probably not a coincidence that I was able to add the AR, Pistol, and Rocket Launcher successfully and those all happen to be weapons the default deathmatch AI uses.

any help is appreciated
 
The deathmatch animator controller doesn't contain a state for those weapons, so you'll need to either create a new animator controller or copy the states from the UCC animator.
 
Okay so I started copying the states from the UCC animator for the shotgun. I found that the shotgun had states in the Arms Layer


1652564225409.png

the Upperbody layer:

1652564205579.png

and Additive layer:

1652564264327.png

so I copied all those states EXACTLY from the UCC animator into the deathmatch demo animator. I did not find anywhere else where there were shotgun specific states.

This changed the behavior somewhat, but it still breaks quickly as you can see in this video:


I'm struggling to find the source of why he stops using the animations properly too because he seems to almost randomly stop shooting and start holding the gun in the weird way he did before he had any shotgun animation states.

Do you know what I could be missing here? I'm a bit of a novice when it comes to animation in Unity so I apologize if I'm doing something dumb here but I can't figure it out.

Thanks
 
When the character is in that walking state I would look at the animator to determine what animations are playing. This could give a clue if the parameters are incorrect or if you're missing an animation.
 
Top