X Tutup
Skip to content

NetworkedList doulbe syncing #457

@Dalilon

Description

@Dalilon

Describe the bug
NetworkedList is not syncing correctly and doubles the entry on client

To Reproduce
Create NetworkedList as example.
Spawn Gameobject on Server
Add 3 things to the NetworkedList

server says .count = 3
client says .count = 6

all entrys are doubled at the client

Expected behavior
3 entrys on Server and 3 on client

Code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MLAPI;

public class TestScript : NetworkedBehaviour
{
    NetworkedList<int> nl = new NetworkedList<int>();
    void Start()
    {
        if (IsServer)
        {
            nl.Add(4);
            nl.Add(20);
            nl.Add(1);
        }
    }
    void Update()
    {
        Debug.Log(nl.Count);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup