Problem with shooting enemies

V01D

New member
Hi,

I've been using the UCC for my game for quite a while now, great tool and all, however I have an issue with shooting enemies using raycast.

On random occasion when I play, the built-in raycasts (OnDamage, OnImpact) seem to stop detecting collision with enemy or doesn't detect it from the start (right after enetering PlayMode the guns shot but don't inflict any damage to the target), sometimes it stops after few shots. Not sure what may be causing this issue. I'm using generic weapons - pistol, assault rifle and shotgun - pistol and AR seem to work fine most of the time, the shotgun stops detecting collision after one shot on most of the trials I did.

I've been checking the forum for similar issue but couldn't find anythin related. I'd be super greatful for your help with this. In case you'd need me to share any scripts or recording of the issue, please let me know.

Cheers,
V
 
The best way to debug this is to place a breakpoint within ShootableWeapon.HitscanFire and look at the raycast to determine what it is hitting.
 
Hello,

Thanks for the tip - I've been trying to setup BreakPoint in various places in the method you mentioned, however, there are so many variables that I'm having hard time figuring out which one should be checked and observed.

I've been playing around trying to figure this out and during gamemode when I tried to reproduce this issue, I strated to receive warning after some time, which didn't show before posting the original question:

Warning: The ShootableWeapon AssaultRifle is unable to fire because of the Look Sensitivity on the ShootableWeaponProperties. See this page for more info: https://opsive.com/support/document...roller/items/actions/usable/shootable-weapon/
UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
Opsive.UltimateCharacterController.ThirdPersonController.Items.ThirdPersonShootableWeaponProperties:CanFire (bool,bool) (at Assets/Opsive/UltimateCharacterController/Scripts/ThirdPersonController/Items/ThirdPersonShootableWeaponProperties.cs:166)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon:UseItemUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:659)
Opsive.UltimateCharacterController.Character.Abilities.Items.Use:LateUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Use.cs:637)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:LateUpdateActiveAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[],int&) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1064)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:LateUpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1050)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:UpdatePositionAndRotation () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:865)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:UpdatePositionAndRotation (bool) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:527)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:OnAnimatorMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1504)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:OnAnimatorMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1793)

Maybe it's the reason why my weapons stop finding the target, if so is there a quick fix for this?

I'll try fiuring it out myself, but would be greatful if you could share some insight on this.

Cheers,
V
 
Top