Hi im new to coding and I’m trying to move a game.object on a grid map one grid up if I press w
But idk how pls help me
You can change a GameObject’s position with:
“obj.transform.position = new Vector2(x, y);”
So if your grid squares are 1x1, and you want to move the object up one square, you’d do this:
Vector2 curPos = obj.transform.position;
curPos.y--;
obj.transform.position = curPos;
Thx worked wonders