Brijesh Posted April 21, 2017 Share Posted April 21, 2017 I have 20 meshes, By connecting each other i make one object and apply rotation to some mashes. Its working fine. Now i want to change position of all meshes dynamically (As per i got a data from server Ex. x = 2 and y = 3 than move all meshes in x and y direction from current position). I set one parent mesh for all 20 meshes and set position of parent mesh but when i set position of parent mesh its set position of only rotated meshes. static meshes's positons are not change. var parentMesh = BABYLON.Mesh.CreateBox('pmesh',50, scene); parentMesh.isVisible = false; for (i = 0; i < a1.length; i++) { a1.parent = parentMesh; } First add all meshes in array a1. parentMesh.position.x = a; parentMesh.position.y = b; But issue is not apply position change effect to all meshes, few meshes position is as it is not change. Please help me out of this issue....!!!!!!!!!!! Quote Link to comment Share on other sites More sharing options...
Temechon Posted April 21, 2017 Share Posted April 21, 2017 Hi ! Can you try to create a PG reproducing this issue ? http://www.babylonjs-playground.com/ It will be faster for us to help you. Thank you Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 26, 2017 Share Posted April 26, 2017 Hi guys. I see a mistake in your code, but the forum caused it. The forum is interpreting the openBracket i closeBracket as a "switch to italics" directive. We'll try a "code block" gotten from selecting "insert code snippet" button in forum editor... for (i = 0; i < a1.length; i++) { a1[i].parent = parentMesh; } There, that looks better. Still need testing playground, though. A1... contains ALL child mesh, rotated or not, right? A1 has length 20? Brijesh 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.