Setting the localPosition of an Instantiated GameObject fails to move the object

Hi!

What’s wrong with this really simple piece of code?
Instead of setting the prefab’s localPosition to 1000,1000, it just puts it to 0, 0.
Debug says it’s on 1000, 1000, yet, it is on 0, 0.

Either it is an Alien Mystery, or a well-sized facepalm.

Since i don’t believe in Alien Misteries, but a have produced a decent amount of facepalms running my rounds around the sun, i’d vote for the facepalm…

Thanks in advance!

EDIT: AFAIK it worked before. A lots of times. Do i remember wrong? Any feedback would be appreciated…

EDIT 2: User error (AKA facepalm. As predicted :slight_smile: ) I Instantiated a wrong prefab, with a script… yaaay…

void DoItPlease(){
    		Vector2 pos = new Vector2(1000f, 1000f);
    		GameObject nextBase = Instantiate(basePrefab, new Vector2 (0,0), Quaternion.identity, gameObject.transform);
    		nextBase.transform.localPosition = pos;
    		Debug.Log("after: " + nextBase.transform.position);
    	}

I suspect you set the scale of the parent to (0,0,0). That would collapse it’s localspace to a single point. So no matter where you place a child, it will always appear at 0,0,0-

If that’s not the case, you should post a screenshot of the parent object transform inspector and maybe one of the instantiated child.