Search Unity

unet how to make customizable characters with 1texture created on runtime work

Discussion in 'Connected Games' started by nek1113, Sep 12, 2019.

  1. nek1113

    nek1113

    Joined:
    Apr 10, 2019
    Posts:
    11
    I am new to unet-mirror . I have player customization , multiple parts with different textures are chosen and then on a press of a button they are combined on runtime. do I need to send the indexes of the parts the player has chosen and then the client bake them locally before getting in the match? or does unet networkmanager.registered prefab handle that? does networkmanager stream an asset created on runtime? or does it need to be created on local instance?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,340
    Unet doesn't have any built in functionality for transferring textures. As for customizing a spawned GameObject, typically you use ClientRPC or SyncVars from the server. I'd imagine from your short description that the player creates their customized texture combining from the available textures, the player's client sends that to the server via a Command or a Message. The server then applies that locally to that client's Player GameObject and either calls a ClientRPC, or uses synced variables to otherwise describe this texture pattern to all the clients. The clients then take that information and apply it locally.
     
    nek1113 likes this.