Hi,
I've implemented a new magic spell which uses the SpawnParticle Cast action with a ParticleSystem. The ParticleSystem has the following components: MagicParticle, ParticlePooler, PhotonView, and PunMagicParticle.
When player 1 casts the magic spell, I noticed the following exception being thrown by player 2:
Must the PunMagicParticle initialize MagicParticle like PunMagicProjectile/MagicProjectile?
Adding the following seems to fix the NullReferenceException for me at least ...
PunMagicParticle:ObjectSpawned:96
Thanks!
I've implemented a new magic spell which uses the SpawnParticle Cast action with a ParticleSystem. The ParticleSystem has the following components: MagicParticle, ParticlePooler, PhotonView, and PunMagicParticle.
When player 1 casts the magic spell, I noticed the following exception being thrown by player 2:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Objects.ItemAssist.MagicParticle.OnParticleCollision (UnityEngine.GameObject other) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/ItemAssist/MagicParticle.cs:106)
Must the PunMagicParticle initialize MagicParticle like PunMagicProjectile/MagicProjectile?
Adding the following seems to fix the NullReferenceException for me at least ...
PunMagicParticle:ObjectSpawned:96
Code:
var magicParticle = gameObject.GetCachedComponent<MagicParticle>();
if (magicParticle != null) {
magicParticle.Initialize(magicItem, (uint)photonView.InstantiationData[4]);
}
Thanks!