Problem about shield block hitscan and projectiles

wuyan

Member
Hello,

1, The BoxCollider of pickup shield will be disable when shield be pickup and equipped. This causes the shield unable to block the projectiles. Please check it. Because UCC demo uses different way, no instantiation process, I am not sure. But, this problem also exists in UIS integration demo.
1626528955996.png

2, Even enable the boxcollider,the shield also cannot block hitscan, but can block projectiles. The code marked in blue below is from ShootableWeapon.HitscanFire(float strength), and I added three debugs. The test result is that hitGameObject is never shield, Although I'm sure the hitscan went through the shield, and the bullet hit shield surface system has taken effect.

// The shield can absorb some (or none) of the damage from the hitscan.
var damageAmount = m_DamageAmount;
#if ULTIMATE_CHARACTER_CONTROLLER_MELEE
ShieldCollider shieldCollider;
Debug.Log(33);
Debug.Log(hitGameObject);

if ((shieldCollider = hitGameObject.GetCachedComponent<ShieldCollider>()) != null) {
Debug.Log(44);
damageAmount = shieldCollider.Shield.Damage(this, damageAmount);
}

#endif
 
Both of those look layer related. What layer is your shield on? I would start by comparing against the demo scene. For the shootable weapon you can adjust what layers the hitscan affects.
 
Both of those look layer related. What layer is your shield on? I would start by comparing against the demo scene. For the shootable weapon you can adjust what layers the hitscan affects.
1, My shield prefab layer is Default,.When equipped, Visualization mesh part will be changed to SubCharacter.

2, Do you mean impact layers in shootable weapon?The screenshot below shows the layers I chose.

1626632292282.png
 
Both of those look layer related. What layer is your shield on? I would start by comparing against the demo scene. For the shootable weapon you can adjust what layers the hitscan affects.
Hi Justin, Are you still paying attention to this problem?
 
1. Looking at this one closer it does look like a problem with runtime pickups. I'll take a look and have it fixed for the next update.

2. I would debug this by setting a breakpoint within ShootableWeapon.HitscanFire and checking the raycast to see if it's detecting the objects that you would expect.
 
Top