Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class PipeController : MonoBehaviour
- {
- public float speed = 2f;
- public float xLimit = -10f;
- void Update()
- {
- transform.position += Vector3.left * speed * Time.deltaTime;
- if (transform.position.x < xLimit)
- {
- Destroy(gameObject);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment