Borislav Posted April 4, 2017 Share Posted April 4, 2017 What is my problem My problem is that I can't find how to change the position of a mesh.. My mesh is like floating above the ground. My script: var char = BABYLON.SceneLoader.ImportMesh("", "obj/", "obj1.babylon", scene, function (newMeshes) { char.position.y = -4; camera.target = newMeshes[0]; As you see, I've tried to make it change position but it simply doesn't work. EDIT : My question got answered. :-) Quote Link to comment Share on other sites More sharing options...
Raggar Posted April 4, 2017 Share Posted April 4, 2017 The mesh(es) is/are imported and referenced in an array called newMeshes. newMeshes[0].position.y = *. Or char = newMeshes[0] etc. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted April 4, 2017 Share Posted April 4, 2017 this is probably what you're trying to do; var char; BABYLON.SceneLoader.ImportMesh("", "obj/", "obj1.babylon", scene, function (newMeshes) { char = newMeshes[0]; char.position.y = -4; camera.target = char; } Quote Link to comment Share on other sites More sharing options...
Borislav Posted April 4, 2017 Author Share Posted April 4, 2017 8 minutes ago, aWeirdo said: this is probably what you're trying to do; var char; BABYLON.SceneLoader.ImportMesh("", "obj/", "obj1.babylon", scene, function (newMeshes) { char = newMeshes[0]; char.position.y = -4; camera.target = char; } Thank you! I hope this will fix my problem. 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.