Im running this in a while loop, creating 50 NPC's, how to ensure that the NPC has actually spawned before spawning the next one?Code:newplayer = global.GameManager.server:CreateEntity( "assets/prefabs/player/player.prefab", ent.transform.position, new( UnityEngine.Quaternion._type, nil ) ) newplayer:Spawn(true)
Detecting if an NPC actually has spawned?
Discussion in 'Rust Development' started by Rusty, Feb 26, 2016.
-
Wulf Community Admin
Have you looked at the Human NPC plugin?
-
Yes, thats where i got this snippet from, the while loop is too fast, i need to make sure that the npc is actually spawned spawned and registered by the server before i create the next one .. versus creating all 50 at once
-
Can you paste the snippet of your loop? Also, couldn't you just use a really short timer?
