PhotonNetwork.Destroy won't always work.

Options
Nonlin
Nonlin
Sometimes it will destroy sometimes it wont' and I can't figure out why.

Here is the script that calls it.
http://hastebin.com/cosacivage.avrasm

Everything else gets called as it should. Debugs tell me it enters the if statements and reaches the PN.destroy.

Comments

  • If you destroy your gameObject, nothing you have scripted to run after that will run. Because your gameObject and all of its scripts (including that one) is destroyed, so you might as well comment out every line that comes after it. As to why it isn't getting destroyed idk, the function has always been reliable for me.
  • Nonlin
    Options
    Actually that isn't true.

    But thankfully I figured out my issue. I had an event that was returning a null error so it wasn't calling in code after it on some runs.

    The error was because I didn't set a character limit on my InputField had it on zero thinking it would mean unlimited. Once I set a limit on the character limit all errors are gone and it works every time now.

    But seriously even code after the destroy works. But perhaps I should just call it last for good measure. Thanks!