gubebraG
Normal10mo ago
5 replies
gubebra

My RealtimeModel is not created

I have added a new script to my gameObject that implements a RealtimeModel. But when I play the game the this.model variable is null

How the script is setup:
public class NCEasyDictionarySync : RealtimeComponent<NCEasyDictionaryModel> 
{
    public NCEasyDictionaryModel Model => this.model;
}

[RealtimeModel]
public partial class NCEasyDictionaryModel {
  [RealtimeProperty(1, true, true)]
  private bool _v1;
  [RealtimeProperty(2, true, true)]
  private RealtimeDictionary<ValuesModel> _valuesDict;
}

[RealtimeModel]
public partial class ValuesModel
{
    [RealtimeProperty(1, true, true)] 
    private int _valueINT;
    [RealtimeProperty(2, true, true)]
    private Vector3 _valueVector3;
    [RealtimeProperty(3, true, true)]
    private string _valueString;
}


It's important to note that I have used this script for ages and it worked so far. Now there's one game object breaking things. It's a prefab btw.

When I enter play mode the RealtimeModel on the RealtimeView is not present so I tried to click Rebuild Realtime View but it didn't help
Was this page helpful?