duck

duck

Jan 28th, 2011
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Pusher : MonoBehaviour {
  5.    
  6.     float oz;
  7.    
  8.     void Start () {
  9.         oz = transform.position.z;
  10.     }
  11.    
  12.     void FixedUpdate()
  13.     {
  14.         Vector3 pos = transform.position;
  15.         pos.z = oz + Mathf.Sin(Time.time) * 0.05f;
  16.         transform.position = pos;
  17.     }    
  18. }
Advertisement
Add Comment
Please, Sign In to add comment