Trying to import glb files into my react project

Hi, i’m using this engine because I want to show Unity assets on my React project.
I right-clicked asset and clicked Needles - Selected Object as glb.
And i got a glb files and I’m trying to use useGLTF in @react-three/drei but it shows context error (I think this is not context problem. I tried almost everything with context).
Next, I tried [ npx gltfjsx myfile.glb ] to make js file with glb but it didn’t work too.
Is there anything i did wrong?
I’m sorry that i’m not good at react and Unity both :disappointed:

Original Post on Discord

by user 976459908180496414

Can you show the error?

Does your asset contain animations?

I assume you have an existing react project that you want to use this with or are you creating a new project?

I usually get this error when I use useGLTF
There are assets with animation and without animation. And both of them didn’t work.
Yes. I’m trying to put it in existing react project! Is it impossible on already existing project?:cry::cry:
image.png

by user 976459908180496414

Astronaut.glb is exported from Unity?

Yes it is

by user 976459908180496414

Hey!
Generally, if you plan to make glTF part of your react workflow, we recommend that you take the time to set things up properly and integrate with Needle Engine. There’s a react template that can show you how to do this, and you can extend/replace that template with your existing code to get a nice integration and workflow.
Goal should be that you can just to changes in Unity, press Play and have your project live.

That being said, the error you have there indicates that “Astronaut.glb” is in fact a HTML file and not a GLB file, so there seems to be something else going on too.

How to import a GLB file in unity whenever I am trying to import the file throwing not supported error.

System.NotSupportedException: Draco compression (using KHR_draco_mesh_compression) isn’t currently supported. Use glTFast instead for loading meshes that use Draco compression.

please guide me what needs to be done in this case

by user 406778568597831690

Please open a new question, happy to answer there