Im working on my first game so I’m a complete beginner when it comes to coding. Is there any way to do this? Right now all enemy does now Is move down the screen.
To move an object in code, you should change enemy.transform.position.
To change to a random position, you’d do something like this:
// enemy is the enemy's gameObject.
// minX/maxX/minY/maxY are the bounds of your game.
Vector2 newPos;
newPos.x = Random.Range(minX, maxX);
newPos.y = Random.Range(minY, maxY);
enemy.transform.position = newPos;