Slot 0 grenade while shooting error

crappygraphix

New member
I've got the character throwing a grenade with the left hand, while having a right hand ballistic weapon equipped, no problem.

The problem arises when the player throws a grenade while shooting. The grenade spawns from strange locations, often behind and to the right of the character, there are also warnings that appear saying that the rifle's settings and sensitivity are preventing it from firing. The ballistic weapon actually continues to fire, but with intermittent pauses.

Is there a way to allow both actions to occur simultaneously, fire and throw? If not, is there documentation or has someone successfully implemented a way to pause a "Use (Slot 1)" in the event of a "Use (Slot 0)"?
 
The controller should be fine with 2 Use abilities going simultaneously, so the only thing you need to look at is the animator. The demo animator isn't setup for that specific case, but there's no reason you couldn't use the right/left arm layers and have a separate animation on each arm playing at the same time, as long as you configure the transitions accordingly. But unfortunately there are no existing easy examples that I can point to, so you may have to do a bit of trial and error (I would recommend looking at the existing animator transitions as a starting point).
 
Updating the animations aided a little bit and the transition from shooting to throwing is clean. I was able to address the errant spawning issue by updating the code ThrowableItem.cs. There is a timing issue where the object is spawned at the initial location of the ThrowLocation and not at the ThrowLocation at the "time of release". Updating the position and rotation inside of ActivateThrowableObject addressed the issue and the throwable spawns in the correct location during the throw animation.

I'm left with one more bug that I am able to duplicate in the demo project. Collect an assault rifle, collect grenades. While firing the rifle in full auto, press "G" to throw an off-hand grenade. You may have to try a couple times but if you manage to throw at nearly the same time as a shot you will get a NPE. There seems to be some issue where StopItemUse is getting called way too early on the throwable during this scenario. I've played with animations, timings, and various wolf fence debug messages but am unable to come up with a root cause.
 
Hm yeah I was able to reproduce this in the demo scene as well after a little while - thank you for reporting this, I'll pass it on Justin and let you know if there's an easy fix for now until hopefully it's fixed in a future update.
 
Top