• Godot Help
  • Sprite in the corner when I want to put it in the origin(or center)

I'm new to game development, and was doing things from Godot docs to learn more about this game engine.

When I was doing most of it, instead of the sprite being in the center when I went into debug mode, it went into the upper-left hand corner.

What do you think I did wrong?

The origin in computer graphics is generally the top-left corner. If you want to place something in the center of the screen, you have to figure out what size the screen is, then add half of that to your object's position. Or, if you're placing the object in the godot editor, you can drag and drop it wherever you want.

var screen = get_viewport().size
var center = Vector2(screen.x/2, screen.y/2)
Icon.position = center