how to transport player

I have tried to move my player w/ transform.position. Such as this code

public class movespot : MonoBehaviour {
	public GameObject player;
	public GameObject objecta;
	// Use this for initialization
	void OnCollisionEnter () {
	objecta.transform.position = player.transform.position;
	}

}

`It doesnt work how should i do this.

This does actually look like it should work, what error are you getting?

On a sidenote: Try to name your classes with nice capitalization in CamelCase (MoveSpot) and give your variables descriptive names (objecta => to, meep => from). This will make your code easier to read, write and debug!

If you post code, click the code button (ones and zeroes) at the top. This will format it nicely.