void setNewSpellDir(Vector3 origin, Vector3 target, int InstantiateID, int OwnerID, PhotonMessageInfo info) { double timestamp = info.timestamp; m_sceneAbilities.RemoveAll(item => item = null); SpellData spell = m_sceneAbilities.Find(item => item.InstantiateID() == InstantiateID); if (spell == null) { Debug.Log("Spell is null!!!!"); } SpellMovement spellMove = spell.GetComponent <SpellMovement>(); spell.setOwnerID(OwnerID); for (int i = 0; i < charMananager.Players.Count; i++) { if (charMananager.Players[i].playerID == OwnerID) { spell.setOwner(charMananager.Players[i].GetComponent <SpellManager>()); } } spellMove.SetCreationTime(timestamp); spellMove.SetStartPosition(origin); spellMove.SetSpellDirection(origin, target); }