Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ServerRpc method gets called twice if exception

Discussion in 'Netcode for GameObjects' started by Crocoder, Jul 6, 2022.

  1. Crocoder

    Crocoder

    Joined:
    Mar 19, 2019
    Posts:
    12
    Hello,

    We have a simple ServerRpc method.

    If an error occurs, the method will run twice.
    If there are no errors - it will run only once as it should.

    We are a bit confused about why it works like that? Could someone give a bit more details / link to documentation?

    upload_2022-7-6_20-25-36.png

    upload_2022-7-6_20-25-49.png

    Best regards
     
    bentrewhella, Nams33 and GibTreaty like this.
  2. bentrewhella

    bentrewhella

    Joined:
    Sep 4, 2014
    Posts:
    8
    Finding same issue on NGO 1.5.2, the exception cannot be caught. First time around the method is called via:
    __endSendServerRpc and handlers, second time is called direct. Whiel the exception is displayed and can be fixed, it's not helpful for the method to be called again, and not clear why this should happen.