get_transform can only be called from the main thread

get_transform can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
UnityEngine.Component:get_transform()
Player:getPos2(Player) (at Assets/Player.cs:20)
Player:DoCheckPlatform() (at Assets/Player.cs:35)

The problem is that I AM calling it from the main thread, so this is more of a bug report?

	void FixedUpdate () {

		this.transform.Translate (Input.GetAxis("Horizontal") / 1600f, 0, 0);

		System.Threading.Thread thread = new System.Threading.Thread (DoCheckPlatform);
		thread.Start ();

	}

Vector3 getPos2 (Player obj) {

		return obj.transform.position;

	}

	float minDistance = Mathf.Infinity;
	GameObject close = null;

	void DoCheckPlatform () {

		if (Physics2D.BoxCastAll(getPos2(this), Vector2.one * 1.1f, 0, Vector2.zero).Length > 1) {

			for (int i = 0; i < ml.gameObjects.Length; i++) {

				if (ml.gameObjects != null) {
					if (ml.game.game [ml.LevelIndex].map _.Type != type.Finish && ml.game.game [ml.LevelIndex].map *.Type != type.Start) {*_

_ GameObject col = ml.gameObjects ;
* if (Vector2.Distance (getPos(col), getPos(this.gameObject)) < minDistance) {
minDistance = Vector2.Distance (getPos(col), getPos(this.gameObject));
close = col;
}
}
}
}*_

* }*

* }*

You do not call it on the main thread. “DoCheckPlatform” runs on a seperate thread. So everything that is called inside DoCheckPlatform will also be run on that thread. So getPos2 is used from a seperate thread and therefore you try to get the transform of your player instance on a seperate thread which is not allowed.

I’m not sure what else i should add to this answer. You clearly use a protected Unity API from a seperate thread. So the error is correct.