Level is not at 0, 0, 0 after setting the coordinates to 0, 0, 0?


I made this script for the level object and set the coordinates to 0, 0, 0:

using UnityEngine;
using System.Collections;

public class Levels : MonoBehaviour {

private int levelWidth;
private int levelHeight;

public Transform NcolWoodOneTile;
public Transform NcolGrassOneTile;

private Color[] tileColors;

public Color NcolWoodOneColor;
public Color NcolGrassOneColor;

public Texture2D levelTexture;

public float tileSideLength = 0.16f;

// Use this for initialization
void Start () {
	levelWidth = levelTexture.width;
	levelHeight = levelTexture.height;
	loadLevel ();

// Update is called once per frame
void Update () {


void loadLevel () {
	tileColors = new Color[levelWidth * levelHeight];
	tileColors = levelTexture.GetPixels ();

	for(int y = 0; y < levelHeight; y++)
		for(int x = 0; x < levelWidth; x++)
			if(tileColors[x+y*levelWidth] == NcolWoodOneColor)
				Instantiate(NcolWoodOneTile, new Vector2(x, y) * tileSideLength, Quaternion.identity);
			if(tileColors[x+y*levelWidth] == NcolGrassOneColor)
				Instantiate(NcolGrassOneTile, new Vector2(x, y) * tileSideLength, Quaternion.identity);


That looks like object 0,0 to me.

I don’t do any Unity 2D but I assume the coordinate space is the same and origin by default is typically screen center.

Edit: Yup just did a quick test. By default (0,0) is screen center in a unity 2D project.

If this seems odd to you, its because Unity2D is not really a 2D game engine in the classic sense. Its a 3D game engine running with an orthogonal view. As such its not bound to screen pixels.

Edit addl: Read this. Unity 2D screen coordinates are based on the orthographic projection in use and the camera position.