HELP!! Changing yincrement on swipe detection

Hey Community,

So I’m new to coding and unity. I’m trying to make an endless runner on mobile. I incorporated swipe mechanics on it but I want to adjust how far up and down the player goes. I can’t figure out how to change the yincrement that the player travels with on a swipe.

I tried changing the player.move line to;

  1. “player.Move(new Vector2 (transform.position.y + yincrement))” and
  2. “player.Move(new Vector2(transform.position.y - yincrement))” with a
  3. public float yincrement; BUT this just generates an error message.

Any help would be great, thanks!

Oh and I just found out my min and max height variable doesn’t work neither…soooo any suggestions on this would be appreciated as well please