Error when using NetworkList "Don't know how to serialize List`1 "
Hello, sorry if this is a simple one, but I'm completely new to NetCode for GameObjects and lost. I am attempting to use a NetworkList as I need to transmit a series of 52 or more floats. However I am receiving compile errors that occur in the Rpc function. "Assets\Scripts\AVNetworkController.cs(116,14): error - Don't know how to deserialize List`1 - implement INetworkSerializable or add an extension method for FastBufferReader.ReadValueSafe to define serialization."
Here's a snippet of how Im attempting to use Network lists. [SerializeField] public NetworkList NetworkFKList;
private void Start()
{
NetworkFKList = new NetworkList<float>();
for (int i = 0; i < 52; i++)
{
NetworkFKList.Add(0f);
}
//Somewhere in here newFKList is populated with values I need that I am attempting to transfer to NetworkFKList
[ServerRpc]
public void UpdateFaceKeysServerRpc(List<float> newFKList)
{
for (int i = 0; i < newFKList.Count; i++)
{
NetworkFKList[i] = newFKList[i];
// I have also tried NetworkFKList.Add(newFKList[i]);
}
}
What am I doing wrong?, seems like Network lists are more complex than I anticipated?
Your answer
Follow this Question
Related Questions
Script to face the direction of the mouse only on the LocalPlayer? 1 Answer
local scale network 0 Answers
UNET (Multiplayer) calling [command] function twice 0 Answers
Flip Character Direction Networking 0 Answers
How to make my game multiplayer? 1 Answer