Assault Rifle reloading clip issue

AbyssGames

New member
Hi,

We're having an issue after following the setup tutorials where the ammo clip stays in the character's hand after completing the reload animation.

I tried copying everything from the demo scene minus the scope camera for now but it still happens.

In the demo scene in the same project the reload animation works as intended on play.

What am I missing? what returns the clip to its original position after the reload?

Thanks in advance.
 
The demo reload animations fire an event called "OnAnimatorItemReloadAttachClip". Open up one of the AssaultRifleReload animations and take a look at the events and you'll see it in there. So your animation will need to fire this event at the appropriate time.

A helpful feature of the Animator Monitor is logging events. Enable this as shown below and it'll print out the name of any event that's called:

1595417953146.png
 
(same person as OP, I'm using my own account so it's easier to follow up)

I activated the logs and it looks like it should be working but it still isn't?

logs.png
 
Do you have the "Reloadable Clip" and "Reloadable Clip Attachment" transform values set properly in that item's First/ThirdPersonShootableWeaponProperties components?

1595841372555.png
 
Yup, I opened a blank project with the demo scene and the test one and compared the fields one by one trying to make sure I had everything.

The thing that drives me nuts is that in the same project as the scene above if I load the demo scene the animation works fine...

1595865844446.png

1595865878286.png
 
Open scene view whilst the reload animation is playing and inspect the clip object during reload and see what happens to its transform parent from beginning to end - it should first be a child of the rifle object, then a child of ORG-hand.L, then go back to the rifle object once the reload animation completes. Do any/all of these changes take place at the correct times?
 
From your previous post, it looks like OnAnimatorItemReloadAttachClip is being fired multiple times, so something's not quite right there - check your reload animation to make sure that event is only being fired once.

You can also start logging what's happening within ShootableWeapon.AttachClip and ShootableWeapon.DetachAttachClip to see if it's getting stuck anywhere.
 
Hi again. I solved my issue and I thought for people with the same issue in the future, this might help!

I had forgot to enable the "Reload detach Attach clip" checkbox under "Reload" on the "Shootable weapon" script.

Silly misstake, now everything works perfect.
 
Top