[HELP] PhotonMessageInfo.photonView null when using OnPhotonInstantiate

Options
I have no idea what's going on.

I have a prefab with a photon view on it and a script that uses OnPhotonInstantiate.

The method is being called, however the photonView stored within the info parameter is null!

Should this not return the photonView on the prefab?

I greatly appreciate any responses! I'm desperate for answers...

Comments

  • Kurtav
    Kurtav ✭✭
    edited June 2017
    Options
    bazz_boyy said:

    I have no idea what's going on.

    I have a prefab with a photon view on it and a script that uses OnPhotonInstantiate.

    The method is being called, however the photonView stored within the info parameter is null!

    Should this not return the photonView on the prefab?

    I greatly appreciate any responses! I'm desperate for answers...


    Tell me what you need specifically from OnPhotonInstantiate get? What data. Then I will show you an example
  • bazz_boyy
    bazz_boyy
    edited June 2017
    Options
    Actually looking back this whole thing is silly, why am I trying to get the photonView on my object from the PhotonMessageInfo parameter when there's a cached reference to the photon view?

    Sorry for wasting your time.

  • Kurtav
    Kurtav ✭✭
    Options
    bazz_boyy said:


    Sorry for wasting your time.

    Everything is fine) I never regretted that I was spending my time living on the development in PUN and for discussion of the PUN))

    Here is an example of how to access this variable of the data type of a PhotonMessageInfo -
    void OnPhotonInstantiate(PhotonMessageInfo info) 
    { 
     if(info.sender.IsLocal) // Then who created the prefab, its owner, receives in this condition = true
                info.sender.SetCustomProperties or info.sender.CustomProperties
    }