Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question ServerRpc and ClientRpc, serialization problem

Discussion in 'Netcode for GameObjects' started by codeBatt, Apr 5, 2023.

  1. codeBatt

    codeBatt

    Joined:
    Feb 12, 2020
    Posts:
    40
    Hello,
    I have a script that spawns an object, then uses a method from a different script to equip() that weapon. I tried to implement a clientrpc() and a serverrpc() to make that happen.
    However, the method that I am using coming from a complicated class, that I could not serialize through the below method.
    upload_2023-4-5_20-17-47.png

    I am getting these errors:
    upload_2023-4-5_20-18-27.png
     

    Attached Files:

  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Does your `Weapon` class follow the guidelines for serialization (here and here)?