Quantcast
Channel: Multiplayer
Viewing all articles
Browse latest Browse all 16796

Teleport skill: Send snap position update to all clients (NetworkTransform)

$
0
0
Hi,

I have a very simple skill that teleports the player 5 units to the front.
This happens on the local player and on the dedicated, authorative server.
However all the other clients need to be updated with the new position instantly (snap), without any interpolation.

Code (csharp):
  1. [Command]
  2. void CmdTeleport() {
  3.     characterController.Move(transform.forward * 5);
  4.     RpcSnapPosition(transform.position);
  5. }
  6.  
  7. [ClientRpc]
  8. void RpcSnapPosition(Vector3 pos) {
  9.     if(!isLocalPlayer)...
Teleport skill: Send snap position update to all clients (NetworkTransform)

Viewing all articles
Browse latest Browse all 16796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>