Hello,
Unity: 6.2
Netcode for GameObject: 2.6.0 (tested also with 2.5.1)
I'm trying to teleport my players (Host/Client) to a specified position. But whatever I do it's not working.
I'm using a NetworkTransform on my players object to sync positions, with the Authority Mode set to Owner. (also tried as Server)
I have a script attached and trying to teleport the player to a new position. But whatever I do, the player moves to new position for a frame then comes back to the same position.
I tried to just simply do:
if (IsOwner)
{
- transform.position = XXX
- GetComponent<NetworkTransform>().Teleport(XXX)
- GetComponent<NetworkTransform>().SetState(XXX)
}
None of this system is working, it's always keep doing the same effect.
Disabling Interpolation doesn't change anything.
Unchecking Position Sync before playing on the Prefab is fixing the issue, but I need it so...
Am I doing something wrong ? Is there any way to do teleportation in a simple way ? (This problem happens with or without connected clients).
In the video, i'm trying to teleport, as you can see, the camera is slightly moving, it's due to the player moving, and sometimes we can even see the player at the new position before it go back to initial position)