# Issue after model optimization / compression

**URL:** <https://forum.needle.tools/t/issue-after-model-optimization-compression/2040>\
**Category:** 🌵 Needle Engine\
**Tags:** question\
**Created:** [November 28, 2024, 10:18pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040 "2024-11-28T22:18:55Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markus](https://forum.needle.tools/user_avatar/forum.needle.tools/markus/32/4027_2.png) [@Markus](https://forum.needle.tools/u/Markus)\
**Post date:** [November 28, 2024, 10:18pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/1 "2024-11-28T22:18:55Z")

</div>

I have a Unity model that runs fine in the Needle engine as long as no animations are applied.

If I apply animations, everything looks well in the Unity Editor. Also during Play-mode in the Editor all animations look good. But when the model is exported to the Needle Engine, some parts are moved a little bit. As this issue occurs not in the Unity Editor, I have no idea where to start debugging…

This is the (scary) image from the Browser with Needle Engine:

 ![image](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/e/e360e00769a5edc0561c91d39faec7ca3e051c59.jpeg)

As I am a new User I cannot upload more than one image and show the original picture from the Unity Editor, but as you can see, the hat and the eyes are not in the correct position

Best regards

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [November 28, 2024, 10:18pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/2 "2024-11-28T22:18:59Z")

</div>

Hi null,

It sounds like you’re experiencing an export issue with animations in your Unity model using Needle Engine. Here are a few debugging steps you can follow to address the problem:

1. **Check Animation Settings** : Verify that your animations are set up correctly in Unity. Sometimes, animations need specific settings, such as root motion or proper clip settings, to work seamlessly when exported.

2. **Export Settings** : Ensure you are using the correct export settings in the Needle Engine. If you are using specific export plugins or settings, review those to ensure they are configured to handle animations properly.

3. **Update Needle Engine** : Check if you are using the latest version of Needle Engine. The changelog indicates that fixes related to exporting animations have been made in recent versions ([see releases](https://github.com/needle-tools/needle-engine-support/releases)). Updating could resolve some compatibility issues.

4. **Hierarchy and Transformations** : Sometimes animation issues arise from how the hierarchy and transforms are set up in Unity. Ensure that the hierarchy is clean and that any parent/child relationships are appropriately set before export.

5. **Debugging Animations** : Use debug logging in the Needle export script to trace through the animation export process. Look for any discrepancies between how the animations appear in Unity and how they are represented in the exported data.

6. **Inspect the Exported Model** : Use the Needle Viewer to inspect the exported model for any errors or warnings related to animations. This could provide insight into what went wrong during the export ([see the documentation](https://docs.needle.tools)).

7. **Testing Without Animations** : Since you mentioned that models work fine without animations, test with simple animations or reduced animation complexity to isolate whether it’s a specific issue with complex animations.

If you continue to experience issues, please let me know the version of Unity you’re using, as well as the version of Needle Engine, and we can investigate further.

Best regards!

_1 replies left_ - **[Get a PRO license](https://needle.tools/pricing)** for more AI replies.  
_thread\_59Z6vk11DnXZuJ44Y0xdTI86_  
_Reply to this message to continue the conversation_

---

<div class="post-metadata">

**Author:** ![Markus](https://forum.needle.tools/user_avatar/forum.needle.tools/markus/32/4027_2.png) [@Markus](https://forum.needle.tools/u/Markus)\
**Post date:** [November 28, 2024, 10:26pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/3 "2024-11-28T22:26:57Z")

</div>

Thanks for the hints. There was indeed an issue with the hierarchy. The hat and the eyes were in the top level and not children of the head. After changing the hierarchy everything works fine now. Strange that it worked in Unity…

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [November 28, 2024, 10:27pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/4 "2024-11-28T22:27:00Z")

</div>

Hi null,

I’m glad to hear that adjusting the hierarchy resolved the issue with your model! Unity’s handling of hierarchy and transformations can sometimes allow for certain setups to work during play mode but cause problems during export, especially in external engines like Needle.

Understanding the parent-child relationships in your model is crucial, especially for animated components. This can lead to unexpected results if not structured correctly when exported.

If you have any more questions or run into further issues while working with Needle Engine or Unity, feel free to ask. Happy developing!

Best regards!

_0 replies left_ - **[Get a PRO license](https://needle.tools/pricing)** for more AI replies.  
_thread\_59Z6vk11DnXZuJ44Y0xdTI86_  
_Reply to this message to continue the conversation_

---

<div class="post-metadata">

**Author:** ![hybridherbst](https://forum.needle.tools/user_avatar/forum.needle.tools/hybridherbst/32/3416_2.png) [@hybridherbst](https://forum.needle.tools/u/hybridherbst)\
**Post date:** [November 28, 2024, 10:33pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/5 "2024-11-28T22:33:17Z")

</div>

Hey, glad you were able to resolve the issue - would you be able to make a bug report with the scene that demonstrates the issue? Shouldn’t happen

---

<div class="post-metadata">

**Author:** ![Markus](https://forum.needle.tools/user_avatar/forum.needle.tools/markus/32/4027_2.png) [@Markus](https://forum.needle.tools/u/Markus)\
**Post date:** [December 1, 2024, 10:31pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/6 "2024-12-01T22:31:05Z")

</div>

Where can I make a bug report? Is there any online form for bug reports or shall I send the scene to you by email? Changing the hierarchy did not fix the issue completely - there are still differences between the Unity Editor and the exported scene. So it would be great, if someone could have a look at this scene.

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [December 2, 2024, 7:18am UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/7 "2024-12-02T07:18:15Z")

</div>

You can send a bugreport using the `Needle Engine/Report a bug` menu item and report with the scene that shows the issue

---

<div class="post-metadata">

**Author:** ![Markus](https://forum.needle.tools/user_avatar/forum.needle.tools/markus/32/4027_2.png) [@Markus](https://forum.needle.tools/u/Markus)\
**Post date:** [December 2, 2024, 7:55am UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/8 "2024-12-02T07:55:19Z")

</div>

Thanks, I submitted a bug report. Meanwhile it turned out, that my assumption was wrong that this issue is related to animations.  
Actually the behavior is pretty strange. When I hit the Needle play button (to export the scene to the web) and reload the browser page quickly, before(!) the Unity export has finished, then the model is shown correctly. When I wait until Unity shows “Export finished” and reload the browser again, then parts of the model are shifted.  
The assumption, that is had something to do with the animations was just based on my timing when I reloaded the page in the browser (loading to early without animations).

---

<div class="post-metadata">

**Author:** ![hybridherbst](https://forum.needle.tools/user_avatar/forum.needle.tools/hybridherbst/32/3416_2.png) [@hybridherbst](https://forum.needle.tools/u/hybridherbst)\
**Post date:** [December 2, 2024, 1:18pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/9 "2024-12-02T13:18:17Z")

</div>

Thanks for sending in a report.

What you’re describing sounds a bit like the model breaks/changes during our automatic compression, which would definitely be a bug.

To verify that, can you disable “Auto Compress” on the Export Info component and check if the model then stays ok?

---

<div class="post-metadata">

**Author:** ![Markus](https://forum.needle.tools/user_avatar/forum.needle.tools/markus/32/4027_2.png) [@Markus](https://forum.needle.tools/u/Markus)\
**Post date:** [December 2, 2024, 4:00pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/10 "2024-12-02T16:00:49Z")

</div>

I can confirm, that the issue does not appear if “Auto Compress” is disabled. The model (including animations) remains ok.

---

<div class="post-metadata">

**Author:** ![Markus](https://forum.needle.tools/user_avatar/forum.needle.tools/markus/32/4027_2.png) [@Markus](https://forum.needle.tools/u/Markus)\
**Post date:** [December 3, 2024, 7:47pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/11 "2024-12-03T19:47:01Z")

</div>

Just another observation: if you build for production (via the build menu) the issue occurs as well, if you do not select the “Development Build” option. Even if “Auto Compress” is turned off. Maybe for production builds the Auto Compression is always on?

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [December 3, 2024, 8:33pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/12 "2024-12-03T20:33:41Z")

</div>

Hello Markus, yes thats true, AutoCompress is basically a preview of the production build assets. Sorry for the inconvenience, we’ll take a look at your bug report asap.

In the meantime what you could also try is to enable AutoCompress again and add the ProgressiveSettings component and then try to disable mesh lods.

Another idea would be adding the Meshcompression component and switching from Draco to Meshopt compression or vice versa or disable mesh compression completely by setting it to None (just for testing purposes)

Related docs:

> **[Needle Engine Documentation](https://engine.needle.tools/docs/deployment.html#production-builds)**
>
> \---
> Deployment is the process of making your application available to the public on a website. Needle Engine ensures that your project is as small and fast as possible by using the latest compression techniques such as KTX2, Draco, and Meshopt.

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [December 9, 2024, 6:10pm UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/13 "2024-12-09T18:10:23Z")

</div>

Hello Markus, could you send another report please? I can not find your report in the system. Please also include a link to this forum post in the description

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [December 10, 2024, 7:44am UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/14 "2024-12-10T07:44:35Z")

</div>

Thank you - we received your report now

---

<div class="post-metadata">

**Author:** ![Markus](https://forum.needle.tools/user_avatar/forum.needle.tools/markus/32/4027_2.png) [@Markus](https://forum.needle.tools/u/Markus)\
**Post date:** [December 10, 2024, 8:05am UTC](https://forum.needle.tools/t/issue-after-model-optimization-compression/2040/15 "2024-12-10T08:05:24Z")

</div>

Hi Marcel, thanks for your feedback. I uploaded the bug report with the scene again. I link to this post is included in the report.

I also tested your recommendations for the export settings: When the mesh lods are disabled, the issue does not occur. This workaround works fine for me.
