Guest User

Untitled

a guest
Oct 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. public class MoveDown : MonoBehaviour {
  2. float posX;
  3. float posY;
  4. float speed = 0.1f;
  5.  
  6. // Use this for initialization
  7. void Start () {
  8. posY = transform.position.y;
  9. posX = transform.position.x;
  10. }
  11.  
  12. // Update is called once per frame
  13. void Update () {
  14. transform.position = new Vector3 (posX, posY, 0);
  15. posY -= speed;
  16. }
Add Comment
Please, Sign In to add comment