Adding a script in Editor moves GameObjects back to Origin.

I just stumbled upon a strange behaviour in Unity. I have this simple script below and when I attach it to any gameobject while the game is NOT running, it moves the gameobject to the origin. If I start the game and add it at runtime, everything works fine.

It’s easy to work around this, but it’s still annoying and I’d like to know what causes that. Here’s the script :

	private Vector3 defaultPosition;
	
	void Start () {
		gameObject.layer = 9;
		gameObject.tag = "Grabbable";
		defaultPosition = transform.position;
	}

	public void Reset() {
		Debug.Log ("RESET CALLED");
		transform.position = defaultPosition;
	}

The method Reset is called when the Component is first added while inside Unity’s editor. Consider renaming your Reset method unless you want it to take effect in the editor.