Can't get TrueSyncInput working

The comments in the source code seems to make sense, but the implementation fails to correspond with what is written. The following source code snippet is what I have right now. Within OnSyncedUpdate the Debug.Log statement never executes. For debugging purposes I've used the owner.Id property of the TrueSyncBehaviour, since it gets confusing if this is for the player ID or some value that allows for multiple items of the same time for more advanced input data. I've also tried meddling with TrueSyncInput.SetAllInputs in OnSyncedInput and trying to obtain the InputData object via TrueSyncInput.GetPlayerInput(owner.Id) from within OnSyncedUpdate, but all I can see are empty InputData objects. I would greatly appreciate some assistance.

void OnGUI()
{
/* some other code handling GUI events here ...
*
*/
InputData id = new InputData();
id.ownerID = owner.Id;
id.AddString(owner.Id, "some string");
localInputDataQueue.Enqueue(id);
}

public override void OnSyncedInput()
{
if (localInputDataQueue.Count > 0)
{
TrueSyncInput.CurrentInputData = localInputDataQueue.Dequeue();
}
}

public override void OnSyncedUpdate()
{
InputData inputData = TrueSyncInput.CurrentSimulationData;
if (inputData.HasString(owner.Id))
{
Debug.Log("inputdata: " + inputData.GetString(owner.Id));
}
}
Sign In or Register to comment.