Advertisement
kadyr

Untitled

Jul 22nd, 2021
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. GameObject buf = Instantiate(crystal);
  2. float x = Random.Range(-radius, radius);
  3. float z = Random.Range(-radius, radius);
  4. buf.transform.position = transform.position + new Vector3(x, 0, z);
  5. float y = terrain.SampleHeight(buf.transform.position);
  6. buf.transform.position = new Vector3(buf.transform.position.x, y, buf.transform.position.z);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement