Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MoveDownConstantly : MonoBehaviour {
- float posX;
- float posY;
- float speed = 0.1f;
- // Use this for initialization
- void Start () {
- posY = transform.position.y;
- posX = transform.position.x;
- }
- // Update is called once per frame
- void Update () {
- transform.position = new Vector3 (posX, posY, 0);
- posY -= speed;
- if (posY < -7f) {
- posY = 7f;
- }
- }
Add Comment
Please, Sign In to add comment