Ayo the first thing I said was to use code tags, read this ( 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
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.
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