Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Wave : MonoBehaviour
- {
- public float amplitude = 1f;
- public float frequency = 1f;
- void Update() {
- float y = Mathf.Sin(Time.time * frequency) * amplitude +5;
- transform.position = new Vector3(transform.position.x, y, transform.position.z);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement