Different prefabs for owner/non-owner players with same Photon View

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Different prefabs for owner/non-owner players with same Photon View

warando
2021-07-12 21:48:00

(Sorry for my bad english) Hey. I'm trying to add multiplayer to my car racing game but I met one problem.

So I have a car prefab with attached Photon View (sharing Rigidbody). I spawn it to the scene using PhotonNetwork.Instantiate and it shows up for both players and works fine. But there is one problem. The prefab contains a lot of scripts / HD interior meshes / audio sources / particles, which are important for the player who owns the car, but they are absolutely unnecessary for the second player who only needs to see the moving mesh of the car. All this puts a heavy load on the players' phones.

So I created simplified version of each car prefab inside Resources/Simplified folder. And I wonder if there is any solution to Instantiate original car prefab for owner and a simplified prefab of the same car for second player (viewer) and make Photon View synchronize their Rigidbodies?

Comments

JohnTube
2021-07-13 11:14:20

Hi @warando,

Thank you for choosing Photon!

I think you can do this using custom prefab pool or manual instantiation.

warando
2021-07-13 11:49:41

Yeah, I think Manual Instantiation is what I needed. Thank you, @JohnTube :)

Back to top