Photon Fusion: Player is despawning as soon as they are spawned in

Hello, I am currently working on a 2d multiplayer platformer shooter and I was working on my project and all of the sudden when play testing my player despawns about half a second after being spawned in. I have looked through my code and can’t find anything, I double checked that I was using a fusion server and the same thing still happens. I will provide my spawn code, player controller code and secondary player controller.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Fusion;
using Unity.VisualScripting;


public class Player_Script : NetworkBehaviour
{
    #region Variables
    public Transform weapon;
    public float ShootCooldown;
    public bool ableToShoot = true;
    public float radius;
    public GameObject player;
    public GameObject projectilePrefab;
    public GameObject firePoint;
    public float projectileSpeed = 40;
    public SpriteRenderer sRend;
    public Collider2D bulletCollider;
    private Transform pivot;
    #endregion
    void Start()
    {
        ShootCooldown = 0.5f;
        pivot = weapon.transform;
        transform.parent = pivot;
        transform.position += Vector3.up * radius;
    }
    #region Shooting
    public  void Update()
    {

        if (HasStateAuthority == false)
        {
            return;
        }


           

            AngleUpdate();
            if (Input.GetMouseButtonDown(0))
            {
                AngleUpdate();
                StartCoroutine("Shoot");
                print("Shot Bullet From Player");
            }


    }
    public void AngleUpdate()
    {
        Vector3 weaponVector = Camera.main.WorldToScreenPoint(weapon.position);
        weaponVector = Input.mousePosition - weaponVector;
        float angle = Mathf.Atan2(weaponVector.y, weaponVector.x) * Mathf.Rad2Deg;

        pivot.position = weapon.position;
        pivot.rotation = Quaternion.Euler(0f, 0f, angle - 90);
    }

    public IEnumerator Shoot()
    {
        {
            if (ableToShoot == true)
            {

                NetworkObject projGO = Runner.Spawn(projectilePrefab, pivot.position, pivot.rotation);
                projGO.transform.position = firePoint.transform.position;
                print(pivot.position);
                print(projGO.transform.position);
                Rigidbody2D rigidB = projGO.GetComponent<Rigidbody2D>();
                rigidB.velocity = pivot.up * projectileSpeed;
                ableToShoot = false;
                yield return new
                WaitForSeconds(ShootCooldown);
                ableToShoot = true;
                #endregion
            }
        }
    }


}
using Fusion;
using UnityEngine;

public class PlayerSpawner : SimulationBehaviour, IPlayerJoined
{
    public GameObject PlayerPrefab;
    public int LobbyCount;

    public void PlayerJoined(PlayerRef player)
    {
        if (player == Runner.LocalPlayer)
        {
            Runner.Spawn(PlayerPrefab, new Vector3(0, 1, 0), Quaternion.identity);
            print("player spawned");
        }
    }
}
using Fusion;
using Photon.Realtime;
using System.Collections;
using System.Drawing;
using System.Linq;
using UnityEngine;

public class PlayerCotroller : NetworkBehaviour
{
    public TrailRenderer trailRender;
    public float speed;
    public float jump;
    public Rigidbody2D rb;
    float moveVelocity;
    public bool isDead;
    public SpriteRenderer spriteRenderer;
    public Vector2[] spawnPointsList;
    public void Start()
    {
        spriteRenderer.color = Random.ColorHSV();
    }
    //Grounded Vars
    public bool isGrounded = true;


    //Check if Grounded

    private void OnCollisionEnter2D(Collision2D collision)
    {
       
        isGrounded = true;

        #region CheckingForBulletHit
        if (collision.gameObject.tag == "Bullet")
        {
            {
                print("PlayerDead");
                gameObject.transform.position = new Vector2(100, 0);
                StartCoroutine("DieAndRespawn");


            }
        }

        #endregion

    }
    private void Update()
    {

        trailRender.startColor = spriteRenderer.color; // <---- Seting color to player color client side
        if (HasStateAuthority == false)
        {
            return;

        }
        #region Movement Code

        //Jumping


        moveVelocity = 0;

        //Left Right Movement
        if (Input.GetKey(KeyCode.LeftArrow) || Input.GetKey(KeyCode.A))
        {
            moveVelocity = -speed;
        }
        if (Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.D))
        {
            moveVelocity = speed;
        }
        if (Input.GetKey(KeyCode.S))
        {
            rb.velocity = Vector2.Lerp(rb.velocity, new Vector2(rb.velocity.y, -jump), 0.1f);
        }
        rb.velocity = Vector2.Lerp(rb.velocity, new Vector2(moveVelocity, rb.velocity.y), 0.1f);

        if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.W))
        {
            if (isGrounded)
            {
                print("player is grounded");
                rb.velocity = new Vector2(rb.velocity.x, rb.velocity.y + jump);
                isGrounded = false;
            }
        }
    }
    #endregion



    IEnumerator DieAndRespawn()
    {

        gameObject.transform.position = new Vector2(500, 0);
        yield return new
        WaitForSeconds(5);
        Vector2 SpawnPoint = spawnPointsList[Random.Range(0, spawnPointsList.Length)];
    }
}

Are you maybe re/loading a scene?

No, I don’t think so, I did find a work around by creating a new player prefab and seemed to just work? Not quite sure what happened. It appears that now Fusion can’t spawn the player in build mode, and sometimes playmode doesn’t work either. I am using the usw for the server connection.

The Error Code:
[Fusion/ [9:00:49 AM] ] StartGame Failed: [StartGameResult: Ok:False, ShutdownReason: Error, ErrorMessage=DnsExceptionOnConnect, StackTrace= at Fusion.CloudServices.ConnectToCloud (Fusion.Photon.Realtime.AppSettings appSettings, Fusion.Photon.Realtime.AuthenticationValues authentication, System.Threading.CancellationToken externalCancellationToken, System.Nullable`1[T] useDefaultCloudPorts) [0x000ef] in Fusion\Fusion.Runtime\CloudServices\CloudServices.cs:226
at Fusion.NetworkRunner.StartGameModeCloud (Fusion.StartGameArgs args) [0x0027f] in Fusion\Fusion.Runtime\Runner\Startup\NetworkRunner.Startup.cs:386 ]
UnityEngine.StackTraceUtility:ExtractStackTrace () (at C:/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[ ])

Fusion Network Settings:
9641555--1370969--upload_2024-2-13_9-20-40.png

The DnsExceptionOnConnect from the log looks suspicious. This seems to prevent the client from connecting in the first place (and then it doesn’t spawn anything for sure).
Maybe your DNS is causing issues? Is it maybe blocking some addresses? We’ve been on random / too strict block lists in some cases (for unknown reasons). Or could your network have temporary issues?
Waiting a second before trying once more in such cases is probably a good enough strategy.

I doesn’t look like the issue will resolve itself, the issue is continuing to persist. What do you mean by DNS issues? All of the photon servers seem to be working, although I did notice that my CCU somehow reached -1? Im not sure how that works, but could that have caused the issue?

CCU being -1 is a problem with the counters. This is being worked on.

Some people run a DNS service like PiHole or use a DNS server entry, which blocks some connections (ads, whatever).
Your device might be off or having a bad connection at that point.

It makes sense to test in another network and or test one of our demos with your AppId.

Ok, I will try to host the program at home, lets hope that fixes the issue, thank you for your help!