# Movement code, unfixable error!

**URL:** <https://discussions.unity.com/t/movement-code-unfixable-error/860013>\
**Category:** Scripting\
**Tags:** Scripting\
**Created:** [October 26, 2021, 10:36pm UTC](https://discussions.unity.com/t/movement-code-unfixable-error/860013 "2021-10-26T22:36:26Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Johan\_Liebert123](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Johan\_Liebert123](https://discussions.unity.com/u/Johan_Liebert123)\
**Post date:** [October 26, 2021, 11:32pm UTC](https://discussions.unity.com/t/movement-code-unfixable-error/860013/7 "2021-10-26T23:32:03Z")

</div>

Ayo the first thing I said was to use code tags, read this ( [https://discussions.unity.com/t/481379](https://discussions.unity.com/t/481379) )  
It’s the same thing as last time, its simple syntax errors, like when you write a English essay, you use a full stop after each sentence, same thing here  
Like

> [@ThatMilkyGamer](#):
>
> public float minHeight

Your missing a ; at the end of it. And you still haven’t formatted it correctly, get rid of all that and I’ll give you a little head start.

```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test : MonoBehaviour
{
    private Vector2 targetPos;
    public float Yincrement;

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            targetPos = new Vector2(transform.position.x, transform.position.y + Yincrement);
        }
        else if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            targetPos = new Vector2(transform.position.x, transform.position.y - Yincrement);
        }
    }
}

```

Now compare both of these codes, yours and mine. See how I’ve formatted it.

KURT REPLIED 6 MINUTES EARLIER, BRO FR

---

_[View the full topic](https://discussions.unity.com/t/movement-code-unfixable-error/860013)._
