Search Unity

Third Party Photon View on trees

Discussion in 'Multiplayer' started by nostalgicbear, Mar 26, 2015.

  1. nostalgicbear

    nostalgicbear

    Joined:
    Mar 21, 2013
    Posts:
    99
    So originally I had a script that was placed on all the trees, and if the players raycast hit the tree, the player could cut the tree. The tree would then fall over, and the player could chop it into wood. However, when there were hundreds of trees, the game ran really slowly, and the frames per second dropped considerably.

    The game Im making is a multiplayer survival game. Should I even bother to put a photon view on trees at all? I want players to be able to see if a tree has been cut down, but is it important that I use a photon view?
     
  2. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Definitely not! Just store a list of trees in your game manager and when you need to chop down a tree, send an RPC from your game manager detailing the index of the tree needed to be destroyed. When the RPC reaches the game managers on the other clients, just access the tree with the index included in the message and do whatever you need with the tree.