Advertisement
Guest User

weweadadad.cs

a guest
Apr 24th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Example : MonoBehaviour {
  5. // Range over which height varies.
  6. public float heightScale = 1.0F;
  7.  
  8. // Distance covered per second along X axis of Perlin plane.
  9. public float xScale = 1.0F;
  10.  
  11. void Update() {
  12. float height = heightScale * Mathf.PerlinNoise(Time.time * xScale, 0.0F);
  13. Vector3 pos = transform.position;
  14. pos.y = height;
  15. transform.position = pos;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement