Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Netcode: How do I get Transform of clientworld into ServerRpc?

Discussion in 'Multiplayer' started by doodler345, Jul 29, 2023.

  1. doodler345


    Dec 30, 2021

    I'm really new to Network programming, I could not find anything usefull on the web yet.

    Short explanation:
    I have 2 players (host and client) . Both should each controll one canon, which are two seperate world objects.

    If I use a NetworkVariable<struct> with the Transform informations in it, I can only change that via Server, trying to change the NetworkVariable via Client is forbidden.
    So I tryed using ServerRpc with "RequireOwnership = false".
    But I did not find a way yet to let the client pass parameters to that ServerRpcFunction.

    That's why in the current state only the host can sync it's own current canon-transforms to the client, but vice-versa.

    Does someone know how to help?