Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Example : MonoBehaviour {
- // Range over which height varies.
- public float heightScale = 1.0F;
- // Distance covered per second along X axis of Perlin plane.
- public float xScale = 1.0F;
- void Update() {
- float height = heightScale * Mathf.PerlinNoise(Time.time * xScale, 0.0F);
- Vector3 pos = transform.position;
- pos.y = height;
- transform.position = pos;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement