Skip to content

Commit 576ee30

Browse files
fix: ingredient spawn position offset (#81)
1 parent 6f6956e commit 576ee30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Basic/ClientDriven/Assets/Scripts/ServerIngredientSpawner.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ void FixedUpdate()
5252
foreach (var spawnPoint in m_SpawnPoints)
5353
{
5454
var newIngredientObject = Instantiate(m_IngredientPrefab, spawnPoint.transform.position, spawnPoint.transform.rotation);
55-
newIngredientObject.transform.position = spawnPoint.transform.position;
55+
newIngredientObject.transform.position = spawnPoint.transform.position +
56+
new Vector3(UnityEngine.Random.Range(-0.25f, 0.25f), 0, UnityEngine.Random.Range(-0.25f, 0.25f));
5657
var ingredient = newIngredientObject.GetComponent<ServerIngredient>();
5758
ingredient.NetworkObject.Spawn();
5859
ingredient.currentIngredientType.Value = (IngredientType)m_RandomGenerator.Next((int)IngredientType.MAX);

0 commit comments

Comments
 (0)