Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Third Party need help with mirror rpc

Discussion in 'Multiplayer' started by Erik2006, Jul 21, 2023.

  1. Erik2006

    Erik2006

    Joined:
    Apr 29, 2020
    Posts:
    3
    idk where to post this, i could not find a mirror unity networking forum. i need help in using rpcs. i switched from photon and dont know how to use the rpcs (and cmds) in mirror. plus, i also could not find any instructions or tutorials except a very hard to understand gitbook page.

    in my project it is about damaging a player (for a shooter game)

    here is how i would do it in pun:

    // called at damager
    void DealDamage(PhotonView target, int damage) {
    target.RPC("RecieveDamage", RpcTarget.ALL, damage);
    }

    [PunRPC] //called at damaged
    public void RecieveDamage(int damage) {
    healthPoints -= damage;
    }

    of course i would do hit detection, raycasting before calling DealDamage and adding UpdateUI and if (hp<0) Die(); but this is the core

    thx for answers
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,801
    If this is Photon then use their support forums/discord etc?

    The Unity multiplayer forum is here, easy to find.
     
  3. Erik2006

    Erik2006

    Joined:
    Apr 29, 2020
    Posts:
    3
    it is mirror, not photon (mirror does not have a forum), but thanks.
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,801