Search Issue Tracker

Duplicate

Votes

2

Found in

2018.3.0a6

2019.1.0a1

2019.1.0b3

2019.2.0a1

2019.3.0a1

Issue ID

1152146

Regression

No

Crash in Transform::GetPosition() const when accessing a transform during OnValidate() first frame

Scripting

-

To reproduce:
1. Open attached project "1152146.zip"
2. Attach "ContainedObjectBehaviour.cs" script to GameObject in the hierarchy
3. Restart Unity

Expected result: the project is launched without any issues
Actual result: Unity crashes at

Reproduced on:
2018.3.0a6 2018.4.0f1 2019.1.0a1 2019.2.0a1 2019.3.0a3

Notes:
- Prefabs are unusable on 2017.4 - 2018.3.0a5
- Reproduces with MONO and IL2CPP
- Stack trace:
#0 0x00000105e659f4 in Transform::GetPosition() const
#1 0x0000010517bf03 in Transform_CUSTOM_get_position_Injected(ScriptingBackendNativeObjectPtrOpaque*, Vector3f&)

Comments (2)

  1. AlexisTessier

    May 03, 2020 10:53

    Edit: "Moving it in OnUpdate (and skipping the first call) resolve the issue." skipping the first OnUpdate call doesn't seem necessary.

  2. AlexisTessier

    May 03, 2020 10:48

    Found what I think to be a related issue (not completely sure about that though). I got a crash when trying to access a transform.position in a JobComponentSystem onCreate method. Moving it in OnUpdate (and skipping the first call) resolve the issue.

    I use some preview packages and not LTS unity version and the workaround is simple, but may these info can help.

    + unity 2020.1.0b1
    + manifest.json {
    "dependencies": {
    "com.havok.physics": "0.1.1-preview",
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.2d.tilemap": "1.0.0",
    "com.unity.ads": "3.4.4",
    "com.unity.analytics": "3.3.5",
    "com.unity.animation.rigging": "0.2.3-preview",
    "com.unity.burst": "1.1.2",
    "com.unity.collab-proxy": "1.3.7",
    "com.unity.entities": "0.1.0-preview",
    "com.unity.ext.nunit": "1.0.0",
    "com.unity.ide.rider": "2.0.2",
    "com.unity.ide.visualstudio": "2.0.0",
    "com.unity.ide.vscode": "1.1.4",
    "com.unity.jobs": "0.1.1-preview",
    "com.unity.mathematics": "1.1.0",
    "com.unity.multiplayer-hlapi": "1.0.4",
    "com.unity.physics": "0.2.4-preview",
    "com.unity.platforms.macos": "0.1.3-preview",
    "com.unity.purchasing": "2.0.6",
    "com.unity.rendering.hybrid": "0.1.1-preview",
    "com.unity.test-framework": "1.1.13",
    "com.unity.textmeshpro": "3.0.0-preview.1",
    "com.unity.timeline": "1.2.6",
    "com.unity.ugui": "1.0.0",
    "com.unity.xr.legacyinputhelpers": "2.0.2",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }

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.