From 197ca052faf6da0f920db008aa8130d0e9df7a98 Mon Sep 17 00:00:00 2001 From: JoshuaReason Date: Sat, 26 Jan 2019 23:30:27 +1100 Subject: [PATCH] Fixed dummies in wrapping --- Assets/Scipts/Map.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Scipts/Map.cs b/Assets/Scipts/Map.cs index 9a61d33..e35ba7a 100644 --- a/Assets/Scipts/Map.cs +++ b/Assets/Scipts/Map.cs @@ -45,10 +45,10 @@ public class Map : MonoBehaviour Player PS = Player.GetComponent(); Transform PT = Player.transform; Transform model = PT.Find("Model"); - PS.dummies.Add(Instantiate(model, new Vector3(PT.position.x + minX, PT.position.y, PT.position.z), transform.rotation, PT).gameObject); - PS.dummies.Add(Instantiate(model, new Vector3(PT.position.x + maxX, PT.position.y, PT.position.z), transform.rotation, PT).gameObject); - PS.dummies.Add(Instantiate(model, new Vector3(PT.position.x, PT.position.y, PT.position.z + minZ), transform.rotation, PT).gameObject); - PS.dummies.Add(Instantiate(model, new Vector3(PT.position.x, PT.position.y, PT.position.z + maxZ), transform.rotation, PT).gameObject); + PS.dummies.Add(Instantiate(model, new Vector3(PT.position.x + (minX - TileSize /2), PT.position.y, PT.position.z), transform.rotation, PT).gameObject); + PS.dummies.Add(Instantiate(model, new Vector3(PT.position.x + (maxX + TileSize / 2), PT.position.y, PT.position.z), transform.rotation, PT).gameObject); + PS.dummies.Add(Instantiate(model, new Vector3(PT.position.x, PT.position.y, PT.position.z + minZ - TileSize/2), transform.rotation, PT).gameObject); + PS.dummies.Add(Instantiate(model, new Vector3(PT.position.x, PT.position.y, PT.position.z + maxZ + TileSize /2), transform.rotation, PT).gameObject); foreach (GameObject dummie in PS.dummies) {