RpcTarget isn't being recognized

Hello, i've run into this error error CS0103: The name 'RpcTarget' does not exist in the current context when trying to call an RPC function and i'm clueless as to how to fix it. In my code i have the class set as Photon.MonoBehaviour and the photonview component is set and all. Am i missing something?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @dai,

    Thank you for choosing Photon!

    RpcTarget is under Photon.Pun namespace in PUN 2 package.
    Photon.MonoBehaviour is from PUN Classic which is the old version of PUN.

    So first make sure your use PUN 2 and not PUN Classic.
    Read the Migration Notes if you are updating from PUN Classic to PUN 2.