Godot Version
v4.5.stable.mono.arch_linux
Question
I happen to be using C# but this question also applies to GDScript.
My understanding is that if you want an object to pass around that’s a bit more complicated than a Dictionary, you should use RefCounted. Here’s mine.
// InputState.cs
using Godot;
[GlobalClass]
public partial class InputState : RefCounted {
public Vector3 trans;
public Vector3 torque;
public float throttle;
}
# player.gd
var input_manual := InputState.new() # from keyboard
var input_automatic := InputState.new() # from autopilot
I would love to just be able to write to the RefCounted, have MultiplayerSynchronizer do it’s thing, then the server acts on the information.
Nothing I do allows input_manual to appear in the replication panel. is there some magic serialization method I’m supposed to implement? Is it just not possible? Please advise.