Mountain Grid

>Mountain has a grid
>King can place on the mountain
>Objects are proberly rotated
>KingGrid has begun to be cleaned up
>Grid Reveal no longer cuts off rows
This commit is contained in:
Katherine
2022-03-21 12:26:27 -05:00
parent b8dbb271c6
commit 9ce623bda0
7 changed files with 554732 additions and 843650 deletions

View File

@@ -11,6 +11,7 @@ public class HailArea : MonoBehaviour
private float Zmax = -85f;
private float Zmin = -115f;
private int Ytop = 600;
int Lifetime = 0;
public GameObject Hail;
@@ -31,9 +32,9 @@ public class HailArea : MonoBehaviour
//Random pos X Xmax-radius -> Xmin+radius
//Random pos Z Zmax-radius -> Zmin+radius
Vector3 position = new Vector3(Random.Range(Xmin + radius, Xmax - radius), 100, Random.Range(Zmin + radius, Zmax - radius));//Finds where the hail will spawn in the air
Vector3 position = new Vector3(Random.Range(Xmin + radius, Xmax - radius), Ytop, Random.Range(Zmin + radius, Zmax - radius));//Finds where the hail will spawn in the air
if (Physics.Raycast(position, transform.TransformDirection(Vector3.down), out hit, float.MaxValue, LayerMask)) {//Raycasts to find where the ground is
height = 100 - hit.distance;
height = Ytop - hit.distance;
}
position = new Vector3(position.x, 100+height, position.z); //find ground and set y occordingly