Alex10 Posted December 29, 2015 Share Posted December 29, 2015 I want to clone the already loaded model and inserted into another location on the map. At the end of the time.var loader = new BABYLON.AssetsManager(scene);var taskMesh = loader.addMeshTask('t3', "", "game/t3/", "t.babylon");taskMesh.onSuccess = function (task) { task.loadedMeshes[0].position = new BABYLON.Vector3(0, 0, 0); task.loadedMeshes[0].parent = camera;};I have not found. Maybe something like this?taskMesh.loadedMeshes[0].clone(); Quote Link to comment Share on other sites More sharing options...
Convergence Posted December 29, 2015 Share Posted December 29, 2015 Did you try your own suggestion? RaananW 1 Quote Link to comment Share on other sites More sharing options...
Alex10 Posted December 29, 2015 Author Share Posted December 29, 2015 I try it does not work, and therefore asked. Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 29, 2015 Share Posted December 29, 2015 did you get an exception? any error? what exactly isn't working? Quote Link to comment Share on other sites More sharing options...
Alex10 Posted December 29, 2015 Author Share Posted December 29, 2015 mesh = loader.addMeshTask('enemy1', "", "/static/game/t3/", "untitled.babylon");mesh.onSuccess = function (task) { task.loadedMeshes[0].position = new BABYLON.Vector3(25, 2, 20);};. . .. . .mesh.loadedMeshes[0].clone('new_mesh');Error:Uncaught TypeError: Cannot read property '0' of undefined Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 29, 2015 Share Posted December 29, 2015 is it possible that you are calling clone before the mesh was loaded? you should clone in the onSuccess function and not before. Alex10 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.