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

Spawning clients with the correct rotation

$
0
0
Code (CSharp):
  1. public class TestNetworkManager : NetworkManager {
  2.  
  3.     public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
  4.     {
  5.         GameObject proxyPlayer = (GameObject)Instantiate(playerPrefab,playerPrefab.transform.position,playerPrefab.transform.rotation);
  6.         NetworkServer.AddPlayerForConnection(conn, proxyPlayer, playerControllerId);
  7.     }
  8. }
  9.  
I have created a new prefab with a location, rotation. The prefab is spawned correctly on the...

Spawning clients with the correct rotation

Viewing all articles
Browse latest Browse all 16796

Trending Articles



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