Guest User

Untitled

a guest
Oct 21st, 2017
66
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 LeftArrow : MonoBehaviour {
  2. float posX;
  3. float posY;
  4. float speed = -0.1f;
  5. // Use this for initialization
  6. void Start () {
  7. posY = transform.position.y;
  8. posX = transform.position.x;
  9. }
  10.  
  11. // Update is called once per frame
  12. void Update () {
  13. transform.position = new Vector3 (posX, posY, 0);
  14. posX += speed;
  15. }
Add Comment
Please, Sign In to add comment