mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
spawn bots at same position
This commit is contained in:
parent
3510361d08
commit
3cd0c847a1
@ -178,15 +178,15 @@ public override void OnServerAddPlayer(NetworkConnectionToClient conn)
|
|||||||
{
|
{
|
||||||
TestNTNetworkAuthenticator.AuthRequestMessage authData = (TestNTNetworkAuthenticator.AuthRequestMessage)conn.authenticationData;
|
TestNTNetworkAuthenticator.AuthRequestMessage authData = (TestNTNetworkAuthenticator.AuthRequestMessage)conn.authenticationData;
|
||||||
|
|
||||||
Vector3 spawnPos = new Vector3(Random.Range(-20, 20), 5, Random.Range(-20, 20));
|
//Vector3 spawnPos = new Vector3(Random.Range(-20, 20), 5, Random.Range(-20, 20));
|
||||||
GameObject player;
|
GameObject player;
|
||||||
|
|
||||||
if (authData.isBot)
|
if (authData.isBot)
|
||||||
player = Instantiate(spawnPrefabs[1], spawnPos, Quaternion.identity);
|
player = Instantiate(spawnPrefabs[1]);
|
||||||
else
|
else
|
||||||
player = Instantiate(playerPrefab, spawnPos, Quaternion.identity);
|
player = Instantiate(playerPrefab);
|
||||||
|
|
||||||
player.transform.LookAt(new Vector3(0f, 5f, 0f));
|
player.transform.LookAt(new Vector3(0f, 2f, 0f));
|
||||||
|
|
||||||
PlayerName playerName = player.GetComponent<PlayerName>();
|
PlayerName playerName = player.GetComponent<PlayerName>();
|
||||||
if (authData.isBot)
|
if (authData.isBot)
|
||||||
|
Loading…
Reference in New Issue
Block a user