But the problem is that it’s like I’m looking at the model from INSIDE the model (inside the pumpkin) instead of looking AT the model from outside the model…
I have put my PumpkinCat.jsx inside the components folder, and created the jsx in the first place cd by first downloading the model files in public folder then cd public → npx gltfjsx pumpkinCat.gltf and copy pasting the pubpkinCat.jsx into components folder.
so it’s the same…nothing changes… how is this the case? it only worked for the Earth component but for any other component it doesn’t seem to work also the camera setting change doesn’t do anything… please help. As you can see when I load screen it shows the leg/feet of cat first exactly like the photo
Also in the original sketchfab model you can see that the cat moves but when I load it like the code above it is static and just doesn’t move - how do I fix this?
Omg thank you so much!! I fixed with adding scale={[0.4, 0.4, 0.4]} to outermost group in Cat.jsx and also setting camera position in app.js to <Canvas camera={{ position: [-120, 120, 400] }}> and now it looks like this:
to run animations you need to log to find the available animations, here i did using console.log(actions); and in log you’ll see an object ,inside it in scopes you’ll find animation clip and its name, in your case its name “Scene”,and just play it.
By the way instead of scaling outer group ,try scaling down Cat group,they’'ll be mostly scale={100} set them to scale={1},and set camera to normal positon [0,0,3] like that…I hope that helps…
just one last question, when I console log actions - it shows up like this in console log - I get the actions[“Scene”] part since there is Scene inside the action returned, but how did you know it was the .play() that made the animation happen? I can’t seem to find the .play() function in the console log…
play() is custom method provided by @react-three/drei ,
as you see we use useAnimations from drei to use animations from imported model and destructure as actions and to play those animations we use play() method…
and “Scene” inside actions is name of Animation clip ,as you can see in bottom , it can be anything instead “Scene” something like “Run” or “Walk” or other whatever name set by model creator,we need to use that name to run animations…