Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Generate code buttons missing from netcode authoring components?

Discussion in 'NetCode for ECS' started by ArraysStartAt1, Sep 17, 2020.

  1. ArraysStartAt1

    ArraysStartAt1

    Joined:
    Sep 1, 2018
    Posts:
    3
    Hi All
    I've decided to finally take a dig into NetCode in unity 2020. Naturally I decided to start with the NetCube Sample (using the code from the github repo) but after copying the files into unity I noticed that Only the Update component list and update ghost list buttons are present on the Ghost and Ghost Collection authoring components respectively. Is this a bug or has it been moved to another place?

    Thanks in advance :)

    Screenshot:
    upload_2020-9-17_13-48-2.png

    Note: I renamed most of the classes and structs from the netcube example

    Here is my package list
    {
    "dependencies": {
    "com.unity.burst": "1.3.6",
    "com.unity.collab-proxy": "1.3.9",
    "com.unity.entities": "0.11.1-preview.4",
    "com.unity.ide.rider": "1.2.1",
    "com.unity.ide.visualstudio": "2.0.2",
    "com.unity.ide.vscode": "1.2.2",
    "com.unity.netcode": "0.3.0-preview.3",
    "com.unity.physics": "0.4.1-preview",
    "com.unity.render-pipelines.high-definition": "8.2.0",
    "com.unity.render-pipelines.high-definition-config": "8.2.0",
    "com.unity.rendering.hybrid": "0.8.0-preview.19",
    "com.unity.test-framework": "1.1.16",
    "com.unity.textmeshpro": "3.0.1",
    "com.unity.timeline": "1.2.15",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }
     
  2. StickyMitchel

    StickyMitchel

    Joined:
    Sep 2, 2019
    Posts:
    19
    This was changed in NetCode 0.3.0, it now automatically generates the code needed.
    There is also a new window where you can see the settings for generating the ghosts under:
    Multiplayer -> Code Generation Window
     
  3. ArraysStartAt1

    ArraysStartAt1

    Joined:
    Sep 1, 2018
    Posts:
    3
    Wow that was fast, thanks :)
    One thing i noticed is that i can no longer toggle components based on where it is, IC, PC S.
    Is that normal as well?
     
    Last edited: Sep 18, 2020
  4. StickyMitchel

    StickyMitchel

    Joined:
    Sep 2, 2019
    Posts:
    19
    Yes that has also changed. According to the Change log for 0.3.0:
    For all ghosts which removes a component from Server, Interpolated Client or Predicted Client you must add a [GhostComponent(PrefabType=<type>)] attribute to the component where <type> matches what you had before.


    In the NetCode 0.3.0 forum thread someone else ran into this problem and a possible solution was posted after it: https://forum.unity.com/threads/dots-netcode-0-3-0-released.955890/#post-6247111