So the documentation says:
function Serialize (ref value : Vector3, maxDelta : float = 0.00001F) : void
A guy gave an example:
stream.Serialize( ref transform.position );
but whenever I try to use this i get the following errors:
stream.Serialize(transform.position);
No appropriate version of 'UnityEngine.BitStream.Serialize' for the argument list '(UnityEngine.Vector3)' was found.
stream.Serialize(transform.position, 0.00001);
No appropriate version of 'UnityEngine.BitStream.Serialize' for the argument list '(UnityEngine.Vector3, float)' was found.
stream.Serialize(ref transform.position);
expecting ), found 'transform'.
stream.Serialize(ref transform.position, 0.00001);
expecting ), found 'transform'.
Someone please tell me what i’m doing wrong ![]()
Thanks it worked with Vector3 position = transform.position; stream.Serialize(position); unfortunately it didn't fix the stuttering over the network at all, it stuck the player character in a small square and won't let it leave/keeps sucking it back in. Thanks for the answer, I'll have to look for a way to smooth network movement elsewhere.
– GrimshadOh, yeah, with Javascript you don't have to use the
– Dave-Carlilerefkeyword. Then again, I thought Javascript was able to deal withpositionbeing a property, but I guess not.