HUGE BUG, after player respawns, bullet shoots from another player

Options

Currently I've just implemented a respawn system in my game, what I do is I just call the my spawn() method on the player who dies, what's happening now is after the player dies, it shoots it's bullet from another player's GO??

I've added this in my shoot method

        if (owner.isPlayerOurs)
        {
            Debug.Log("Shooted");
        }

Before any player dies, it debugs this in the console for only that player who shoots. Lets use player 1 and 2

If player 1 kills player 2, player 2 respawns after 5 seconds, when it tries to shoot, bullet is instantiated from player 1. BUTTT nothing is debugged in player 1's console. I also check the bullet in the hierarchy and it displays player 1 as it's owner, instead of player 2, but nor player 1 or 2 has nothing debugged in it's console, if player 1 shoots normally, it will work properly and 'Shooted' is debugged in player 1's console

I checked the photonView's and there correct for each player.

How is this happening, there's really no explanation.

 

Answers

  • Tobias
    Options

    Sorry for the really late reply. I hoped someone will chime in.

    I do not understand enough of this case to determine if it's a PUN problem. It sounds as if someone's references and or checks for "ownership" are incorrect. This is not really something we can help with, as Photonians, sorry.

    Maybe you can rephrase the problem and someone may chime in?

  • Thanks for your reply,

    But apparently changing my shoot function which was a corruptive to an RPC Fixed it, I did change it back to see if it was the coroutines fault and it did start to happen again, so maybe something broken when dealing with coroutines and photon

  • Tobias
    Tobias admin
    edited December 2022
    Options

    Glad you found a workaround / fix. Without knowing more details, I'll just set this aside as "unknown".