Ploopploop

Problems with importing models

Recommended Posts

I want to import my .babylon model with animation into my code but the model didn't appear and if it does appear, the animation won't work.

This is the code 

var human = new BABYLON.Mesh.CreateBox("human", 1.0, scene);
        human.isVisible = false;
        human.position.y = 0;
        human.position.x = 0;

        BABYLON.SceneLoader.ImportMesh("", "models/Vanquish/Human/", "Humans.babylon", scene, function(newMeshes, particleSystems, skeletons){
            skeleton = skeletons[0];
            skeletonMesh = newMeshes[0];
            scene.beginAnimation(skeleton, 0, 20, false, 2.5);
            for(i = 0; i < newMeshes.length; i++){
                newMeshes.parent = human;

            }
        });

Share this post


Link to post
Share on other sites

Hiya PP, welcome to the forum.

See this BJS playground scene?

https://www.babylonjs-playground.com/#WMW8#8

Can you edit that (as often as you like) and make new saves (as often as you like)... and somehow get your Humans.babylon (or some other SMALL/SIMPLE .babylon file... to load-in from a public/github URL/location?

That would make it easier for us to help.  I hope it is a simple/basic scene... something small to troubleshoot the mesh loading.  A small .babylon file is good to start-with, using simple and short animation.  Please try to provide these things.  Thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.