I’m doing the hello world tutorial p2.
So far so good, but when i got to the networked transform part, it just doesn’t seem to work.
On the server window, i can see the prefab moving in a circle, but on the client it’s just sitting where it spawned.
I can’t really tell what could go wrong, considering how few components there are in play.
Are you testing in a build, or using ParrelSync? If build, have you tried starting either the client or server from the editor, and launch the build for the server/client? Either way helps to see the Console output.
Do you get two spawned player instances on both client and server?
How are you moving the player instance?
What is in the HelloWorldPlayer script? Why is it disabled (unchecked)? Could that be the issue?
This is the part i’m referencing.
I’m not sure what ParrelSync is.
I test by making a build, clicking starting “server”, so that there is no player on the host, and then in another build i start as client, so that there is only one “player”.
I’ve tested before by making my own tweaks to the basic “Position” calculation introduced in the series and that worked on both server and client.
Currently i only have the “NetworkTransformTest” script from the page enabled, so nothing should be interfering.
This is ParrelSync: GitHub - VeriorPies/ParrelSync: (Unity3D) Test multiplayer without building
It allows you to clone your current project and open it in a second Unity Editor instance. That way you can test networking without having to make builds, and you get the console logs and can debug both instances separately as needed.
Hard to say what is wrong here. Maybe take a step back, revert the changes from this part of the tutorial and start over. Or maybe test with host and client so you get two players, maybe one works but not the other.
using System;
using Unity.Netcode;
using UnityEngine;
public class NetworkTransformTest : NetworkBehaviour
{
void Update()
{
if (IsServer)
{
float theta = Time.frameCount / 10.0f;
transform.position = new Vector3((float) Math.Cos(theta), 0.0f, (float) Math.Sin(theta));
}
}
}
It seems to be working right now. All i did was remove NetworkTransform and NetworkTransformTest and re-add them, Nothing else.
This kind of makes me afraid of how “stable” the new system is.