needle-engine-support
needle-engine-support copied to clipboard
Transform with rect transform parent in UI Canvas is offsetted (since Needle exporter 3.3.0)
Describe the bug š¬
I have a quad mesh nested under a rect transform parent in a UI canvas next to other UI elements. The position is displayed correctly in the Unity editor but gets a offset in the web export of Needle. This transform hierarchy worked fine until the needle update 3.3.0 with improved RectTransform support.
Operating System š©āš»
Windows
What browsers are you seeing the problem on? šāāļø
Chrome
Editor Version š²
2021.3
Needle Exporter version
3.6.10
Project Info (Unity only) š
{
"ExportInfoGameObjectName": "Export",
"ExportInfoGameObjectIsEnabled": true,
"UnityProjectPath": "F:/Git/ukhalle-digivid/development/Digivid/Assets",
"UnityVersion": "2021.3.15f1",
"SceneName": "UI-Transform-Bug",
"ProjectPath": "Needle/UI-Transform-Bug",
"ProjectDirectoryExists": true,
"ProjectIsInstalled": true,
"NeedleEngineInstalled": true,
"HasNodeInstalled": true,
"NodeVersion": "v16.18.0",
"NpmVersion": "8.19.2",
"TypescriptVersion": "'\u0000t\u0000s\u0000c\u0000'\u0000 \u0000i\u0000s\u0000 \u0000n\u0000o\u0000t\u0000 \u0000r\u0000e\u0000c\u0000o\u0000g\u0000n\u0000i\u0000z\u0000e\u0000d\u0000 \u0000a\u0000s\u0000 \u0000a\u0000n\u0000 \u0000i\u0000n\u0000t\u0000e\u0000r\u0000n\u0000a\u0000l\u0000 \u0000o\u0000r\u0000 \u0000e\u0000x\u0000t\u0000e\u0000r\u0000n\u0000a\u0000l\u0000 \u0000c\u0000o\u0000m\u0000m\u0000a\u0000n\u0000d\u0000,\u0000; \u0000; \u0000o\u0000p\u0000e\u0000r\u0000a\u0000b\u0000l\u0000e\u0000 \u0000p\u0000r\u0000o\u0000g\u0000r\u0000a\u0000m\u0000 \u0000o\u0000r\u0000 \u0000b\u0000a\u0000t\u0000c\u0000h\u0000 \u0000f\u0000i\u0000l\u0000e\u0000.\u0000; \u0000; \u0000",
"HasTokTxInstalled": true,
"HasMinimumToktxVersionInstalled": true,
"RenderPipeline": "URP-HighFidelity (UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset)",
"GzipEnabled": false,
"NeedleEngineExporterVersion": "3.6.10",
"NeedleEngineVersion": "3.6.10",
"NeedleEngineExporterPath": "Packages/com.needle.engine-exporter/package.json",
"NeedleEnginePath": "F:/Git/ukhalle-digivid/development/Digivid/Assets/../Needle/UI-Transform-Bug/node_modules/@needle-tools/engine/package.json",
"FileStats": "By Type:\r\nā¢\t.json ā x 8 = 0.4 mb\r\nā¢\t.png ā x 8 = 0.8 mb\r\nā¢\t.mp3 ā x 2 = 0.1 mb\r\nā¢\t.glb ā x 1 = 0.1 mb\r\nā¢\t<b>Total = 1.3 mb</b>\r\n----\r\nBy Directory:\r\nā¢\tassets ā x 19 = 1.3 mb\r\n",
"NeedleComponentsInScene": [
"Needle.Engine.ExportInfo",
"Needle.Engine.Codegen.ComponentGenerator",
"Needle.Engine.Deployment.DeployToGlitch",
"Needle.Engine.Components.GltfObject",
"Needle.Engine.Components.ObjectRaycaster",
"Needle.Engine.Components.WebARSessionRoot",
"Needle.Engine.Components.WebXR",
"Needle.Engine.Components.OrbitControls",
"Needle.Engine.Components.GridHelper",
"Needle.Engine.Components.AxesHelper"
],
"TypeCacheIsDirty": false,
"TypeScriptTypes": []
}
Steps to reproduce š¢
1.Create a minimal scene with needle exporter 3.3.0 or higher
2.Create a Canvas with a cube and an UI image in it
3.Nest cube and image under a parent (Rect Transform by default)
4.Move the parent out of world origin.
5.Compare position of the cube in Unity Editor and Needle Web Export
6.Change the Rect Transform of the parent into a Transform - the cube gets now placed correctly but the UI image with its Rect Transform is offsetted.
See also sample scene attached.
Reproduction ā»
Discord or Discussion link
https://prefrontalcortex.slack.com/archives/C03SCU2KF7B/p1684173720122769?thread_ts=1683907384.631879&cid=C03SCU2KF7B
Validations š©¹
- [X] Follow our Code of Conduct
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Needle-Engine-specific issue. For example if it's a Unity related bug, it should be reported to Unity instead.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.