Photon Transform View keeps getting added

Options
Hello - caveat here is I am definitely a PUN2 noob.

I'm playing with the slot car demo, and I found that if I remove the "observed component" from the Photon View on the slot car "Player Controller", and then add it back, a new component is automatically added called "Photon Transform View".

If I test the app after doing this, multiplayer breaks and the slot car no longer follows the track (but it does seem to move a bit, presumably due to the new photon transform view component. Somehow this prefab was made initially without this "photon transform view" component, but I can find no way of making my own components in a way that does not have this automatically added.

Any help greatly appreciated, thanks.

Comments

  • Federico123
    Options
    dskill wrote: »
    Hello - caveat here is I am definitely a PUN2 noob.

    I'm playing with the slot car demo, and I found that if I remove the "observed component" from the Photon View on the slot car "Player Controller", and then add it back, a new component is automatically added called "Photon Transform View".

    If I test the app after doing this, multiplayer breaks and the slot car no longer follows the track (but it does seem to move a bit, presumably due to the new photon transform view component. Somehow this prefab was made initially without this "photon transform view" component, but I can find no way of making my own components in a way that does not have this automatically added.

    Any help greatly appreciated, thanks.

    Do you get any errors or something?
  • dskill
    Options
    I'm not getting any errors or warnings, no. As far as I can tell, the version of the prefab that has the "Photon Transform View" added does not properly send the car spline position and speed over the network. Attached are images which show the difference between the prefab that came with PUN2, and what happens when I remove, and then add back in, the Player Controller component as an "observable component".

    Player Controller from PUN2 package:
    https://photos.app.goo.gl/AzRY5mZeZkF1L9Pe6

    Player Controller after removing, and adding back in, the same observable component:
    https://photos.app.goo.gl/cn3E2vca8K9RBfud7
  • dskill
    Options
    ohhh - now I see that under the observed components list, originally it was a "Player Controller (Player Control)" that was selected. When I remove and re-add it, it becomes a "Player Controller (Photon Transform View)" that gets added.

    Any tips on how to pick which component gets "observed" ? I don't see a way of specifying specific components...
  • dskill
    Options
    also at Federico, you were right. I'm seeing this in the log when I add the observed component back:

    "PhotonView has detected you dropped a Transform. Instead it's better to observe a PhotonTransformView for better control and performances"
  • dskill
    Options
    ugh face slap. Hopefully this helps someone else.

    You have to actually drag the "Player Control" component from the inspector onto the "observed component" slot. I was dragging the prefab itself onto the "observed component" slot.
  • Federico123
    Options
    dskill wrote: »
    ugh face slap. Hopefully this helps someone else.

    You have to actually drag the "Player Control" component from the inspector onto the "observed component" slot. I was dragging the prefab itself onto the "observed component" slot.

    I have done that sometimes by a mistake too, your not the only one here.