mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-27 04:44:58 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user