Trying to Get touch input working for a pong game i'm working on.

I’m new to Unity I’m making a pong game and trying to get the paddle to go up and down through touch.

This is what i have for the movement right now, but this is just keyboard, I’m not sure where to start building on touch, no tuts i’ve seen are updated enough, are there trying to do way to much and i can’t get them to work in my game.

I just need the paddle to go up and down through touch…

public float paddleSpeed = 1;
public Vector3 playerPos;

private Vector2 touchOrigin = -Vector2.one;

// Update is called once per frame
void Update()
{
float yPos = gameObject.transform.position.y + (Input.GetAxis(“Vertical”) * paddleSpeed);
playerPos = new Vector3(-10, Mathf.Clamp(yPos, -18f, 10f), 0);
gameObject.transform.position = playerPos;

}

First off, it’s good practice to make your code as readable as possible, for your sake, and others as well. That being said, I would make a couple variables to keep things simple so your not cramming so much into one line. Now for your question. I would create a UI Canvas and add a panel to the canvas. Then fit the panel on the canvas to where you would want the input to be active (much like a button), then add an EventTrigger Component to the panel, then take it from there. For reference, check out this video.