how to instantiate an object that exist in the scene

Options

hi im working on a game, and im trying to instantiate an object that is not existed in the resources file using PhotonNetwork.instantiate but it not being instantiated ,it is only exists in the scene, i also make some modifications to the object before i instantiate it ,can anyone help me fix this issue?

thanks!

Answers

  • Tobias
    Options

    You could possibly just put a placeholder object into the resources and instantiate that. The Instantiation Data (see docs) could be used to customize the placeholder into the object, which was created at runtime.

    Obviously, you need to be able to sync effectively what makes the object. What parts to use, etc.

  • ziyad1160
    Options

    NO my problem is that i dont want to take the object from any file, i wanna take it from the scene , that is the only way to solve my problem

  • ziyad1160
    Options

    its not really important to use PhotonNetwork.instantiate , if there any other method please help me

  • Tobias
    Options

    The key to use PhotonViews is to pick a ViewID and have each client in a room use it for the same object (no matter the visuals of the object). You don't have to use PN.Instantiate if you manage this yourself.

    There is a doc section called Manual Instantiation, which is related. Again, it just shows one way to do it.

  • ziyad1160
    Options

    can you show me other way please

  • Tobias
    Options

    If you tell me why the Manual Instantiation is not a solution for you, maybe.

    This is actually a task you as developer have to solve, really. We provide an API and docs. You figure out how to make your game work.

  • ziyad1160
    Options

    Thanks, I solved this problem