Okay, the title may be confusing cause I don't how to know put it.
My case: I have a 2d sprite with 4 child objects, each one place around the sprite as a perimeter. So it looks like this:
Spawner2 has a script with the following method, which is called at the start of the game. Inside the script, I instantiated a new prefab:
public void GenerateBox(int count)
{
...
GameObject spawnedRoom = Instantiate(possibleRooms[chosen], transform.position, Quaterion.identity);
}
But this instantiates the object at Spawner1's location.
So I tried to debug. I pulled Spawner2 out of its parent and see the location (which is X: 1.0062, Y: -0.0038). I put it back inside the 2d sprite and when I debug.log it's position, it gives me X: 0, Y: 1, Z: -9.8.
Is it because of my prefab? What is the problem and how can I fix it?