Search Issue Tracker

Fixed in 2018.1

Fixed in 5.6, 2017.1, 2017.2, 2017.3

Votes

36

Found in

5.6.3p3

Issue ID

953068

Regression

Yes

Game object transform.position is incorrect after Object.Instantiate after Awake() function call

Scene Management

-

How to reproduce:
1. Download attached project files and open "test" Scene
2. Enter Play mode. Notice now the world-space location in Awake is printing the prefab location as opposed to the location passed to instantiate:
Parent(Clone): World-space location: (-10.0, 20.0, 0.0)
Child: World-space location: (-10.0, 20.0, 0.0)

Not reproduced:
1. Open project with Unity 5.6.3p2 and hit "play". Notice that "World-space location" printed in SpawnLog.Awake now outputs location as expected according to SpawnPrefab-script:
Parent(Clone): World-space location: (50.0, 100.0, 0.0)
Child: World-space location: (50.0, 100.0, 0.0)

Actual result: Instantiate(Prefab, new Vector3(50, 100, 0), Quaternion.identity) applies world position incorect in Debug.Log(transform.postion) after Awake() function call

Reproduced with: 5.6.3p4, 2017.1.1p3, 2017.2.0f1, 2017.3.0b2
Not reproduced with: 5.6.3p2, 2017.1f1, 2017.2.0b8, 2017.3.0a5
Regression since: 5.6.3p3
---------------------------------------------------------------------------------------
Fixed in 2017.1.2p3, 2017.2.0p1, 2017.3.0b5

  1. Response avatar

    karl_jones

    Jan 12, 2018

    The fix for this will be available in the following patches:
    5.6.5p1
    2017.1.2p3
    2017.2.0p1
    2017.3.0b5

Comments (43)

  1. 0e34cac96faf280850d9858607c3c57e?d=mm

    shadiradio

    Dec 13, 2017 20:37

    @manutoo - Much appreciated! I wasn't aware that you can modify the prefab transform information before instantiating and they would be passed through. I'll give it a shot today - thanks.

  2. 6fb4d2637ba838becc92cc9bead52f96?d=mm

    manutoo

    Dec 11, 2017 14:25

    @shadiradioI,
    there's an easy workaround ; change from :
    GameObject Obj = GameObject.Instantiate(m_FxPrefab, Pos, Rot) as GameObject;
    to :
    m_FxPrefab.transform.position = Pos;
    m_FxPrefab.transform.rotation = Rot;
    GameObject Obj = GameObject.Instantiate(m_FxPrefab) as GameObject;

    If for some reason, you need the original prefab position & rotation somewhere else, then backup them & either use the saved values or restore them after the call to Instantiate().

  3. A78b31ebb4d37f96a5b896e48bfae515?d=mm

    DimaDDM

    Dec 07, 2017 21:09

    Have this problem in 2017.2.0f3

  4. 0e34cac96faf280850d9858607c3c57e?d=mm

    shadiradio

    Dec 07, 2017 18:40

    Unfortunately, it's not in the patch notes for 5.6.4p4. I'm not sure how many weeks (months?) I'll have to delay my upcoming patch. Unity - if you think I'm being annoying, try making a game without knowing object positions.

  5. 0e34cac96faf280850d9858607c3c57e?d=mm

    shadiradio

    Dec 06, 2017 16:55

    Is this going to be fixed for 5.6.4p4? Is there a workaround for this?

  6. 0e34cac96faf280850d9858607c3c57e?d=mm

    shadiradio

    Nov 30, 2017 05:45

    Is there any status update on this issue? I'm worried that it won't get internal visibility because it's marked as resolved. :(

  7. 584d5bd0fc4b47548ca13a1e5594ec1b?d=mm

    nas4eva

    Nov 23, 2017 09:44

    This is still not fixed in 5.6.4p3

    Please, please, please fix this!

  8. 584d5bd0fc4b47548ca13a1e5594ec1b?d=mm

    nas4eva

    Nov 23, 2017 09:44

    This is still not fixed in 5.6.3p2

    Please, please, please fix this!

  9. 8b696f3ca40d6b46eb13283d6f41022c?d=mm

    kuro_sk

    Nov 21, 2017 16:14

    2017.2.0f3 personal still has this problem. Why was this issue closed?

  10. Bd7e57a5852c02332af1de6346b75b84?d=mm

    Brent_The_3D_Guy

    Nov 21, 2017 12:56

    This is still not fixed in 2017.2.0f3.

    Please, please, please fix this!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.