# Scrolling code, extra feature...

**URL:** <https://discussions.unity.com/t/scrolling-code-extra-feature/706234>\
**Category:** Scripting\
**Tags:** Scripting\
**Created:** [June 26, 2018, 12:09pm UTC](https://discussions.unity.com/t/scrolling-code-extra-feature/706234 "2018-06-26T12:09:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Stevens-R-Miller](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/stevens-r-miller/32/92319_2.png) [@Stevens-R-Miller](https://discussions.unity.com/u/Stevens-R-Miller)\
**Post date:** [June 26, 2018, 12:39pm UTC](https://discussions.unity.com/t/scrolling-code-extra-feature/706234/3 "2018-06-26T12:39:39Z")

</div>

Hi Ben,

When you post code, try using [code tags](https://discussions.unity.com/t/481379) (\<== click on this link) to make it look like it does in your code editor:

```auto
public class Scroller : MonoBehaviour {
    public float speed;

    Vector3 startPos;
    // Use this for initialization
    void Start () {
        startPos = transform.position;
    }

    // Update is called once per frame
    void Update () {
        transform.Translate((new Vector3(-1, 0, 0)) * speed * Time.deltaTime);
        if (transform.position.x < -21.8)
            transform.position = startPos;
    }
}

```

---

_[View the full topic](https://discussions.unity.com/t/scrolling-code-extra-feature/706234)._
