I instantiate a prefab gameObj and I immediately change it’s position.y
The problem is that gameObj’s position.X is changed by an animation. But this animation does not affect position.y. Note that position.y does not appear on the Animation window when gameObj is selected (only position.x is).
So my script is not able to spawn that prefab at desired y-position.
It stays at y=0.
How can I set the y-coordinate of a gameObject when the x-coordinate is affected by an animation?
In your prefab’ script you could use transform.Translate();, transform.position.Set(); or maybe transform.position = new Vector3() (in C#).
In your instantiate script you could use GameObject.Instantiate(yourPrefab, new Vector3(0, 1, 0), Quaternion.identity); where in this case the Y axis would run 1.
If your animation modifies only the X axis then the other ones should be free.