Projectiles Stop During Flight

zcorsair

New member
UCC v 3.0.13
UCC MP Addon v2.05
Unity v 2022.3.1f
Photon PUN2 2.42


As in the demo, our controller does the same thing as the arrows with bullet projectiles. On startup the assault rifle's first 10-20 shots stick in the air, after that everything works great.

The demo video is a fresh project install, fyi.

I have been working on the controller almost daily for the last 7 months. In May I upgraded to v3.011 and have been converting from UCC v2 ever since, initially the projectiles worked, I still have a backup from back then and the projectiles work as expected. It has been pretty smooth upgrading overall, except for a couple of issues. This one I can't solve at the moment seems to be related to either UCC v3.0.13 or the UCC MP Addon 2.05.

Thank you for a great product and I look forward to hearing from you.
 
Thanks for the report. I'll make sure this is fixed for the next multiplayer update.
 
I think that I have this one figured out. Within TrajectoryObject initialize the simulation index to -1:

Code:
private int m_SimulationIndex = -1;
 
3.0.14 solved the frozen projectile for the most part. The second issue I am having is the projectile behaving differently in multiplayer. As you can see in the demo, projectiles stop at the player (just like before in v3.0.13) and they don't seem to trigger the surface system correctly, although they do cause damage. The hit scan weapons work perfect. Thanks in advance!
 
Good catch. It looks like when PunProjectile is initializing the object it is overwriting the surface impact. I will take a look at this and let you know the fix.
 
Ok, you can fix this by changing line 69 within PunProjectile to:

Code:
            Initialize((uint)m_InstantiationData[0], (Vector3)m_InstantiationData[1], (Vector3)m_InstantiationData[2], owner != null ? owner.gameObject : null, m_DamageData, true);

The Initialize method on line 155 of ProjectileBase should then be changed from:

Code:
        public virtual void Initialize(uint id, Vector3 velocity, Vector3 torque, GameObject owner, IImpactDamageData impactDamageData)
        {
            InitializeProjectileProperties(id, impactDamageData);
to:
Code:
        public virtual void Initialize(uint id, Vector3 velocity, Vector3 torque, GameObject owner, IImpactDamageData impactDamageData, bool useObjectImpactLayerAndSurface = false)
        {
            InitializeProjectileProperties(id, impactDamageData, useObjectImpactLayerAndSurface);
 
Right on, that seems to have solved it. The surface impact
effects are behaving correctly now. Thanks again.
 
Top