How to use the same random.range value?

Hey guys, I’m a noob and in my game I’ve got an object (object y) that spawns at a random spot on the y axis, but I need another object (object z) to spawn at the exact same spot on the y axis as object y. Is there a way I can store the random.range value that is used for the y axis so both of the objects can use it as a spawn point?

So I managed to solve it. What I did was created a blank gameobject in the scene and made its children the 2 sprites. I moved the anchor points of the 2 sprites so they matched up perfectly, then made that parent object a prefab by dragging it back into the sprite folder. I went into the spawner script and changed the object that was to be spawned to the parent prefab gameobject (which contained the 2 sprites as the children), so now they spawn as one while still having one part of the sprite in front and the other behind.