3d Scripting Animation Problems
Hi, I'm an artist with no experience in coding -I'm trying to make an AR sculpture I created to rotate, I created the model/animation in blender and exported it in the fbx format following the Blender 3d object export parameters, the model opened in Lens Studio and there is an animations folder, I tried to set up a script but it just isn't working - any advise?
Hey Alessandro,
Happy to hear you're pushing the boundaries of your Lens creating and utilizing our guides to help create your Lens. I see you followed the 3D object export guide for blender, but did you also follow the playing 3D animation guide?
Best,
Kaitlyn
Hi Kaitlyn,
I followed the instructions in the guide and get this error:
Error: Argument 1: Value is not a number
at [anon] () native strict preventsyield
at [anon] (play:16) preventsyield
Any idea's what that means? Thanks so much for your help!
Hey Alessandro, it would appear that you didn't add your animation mixer to the script in the Inspector panel. Select the object you added your script to in the Objects panel. Then, in the Inspector panel, find the added PlayAnimation script. Your script will look something like this:
Likely, the reason for the error is that Animation Mixer is set to "None". Double click the field and select an animation mixer in your project. Once you've done this, the script in the Inspector panel should now look something like this:
Now, in the preview Panel, click refresh and your animation should now work. Hope that helps!
Hi Travis,
It worked! Thanks a lot!