vahith Posted May 6, 2015 Share Posted May 6, 2015 hi all, i am creating multiple meshes with parent and child relationship. Here my question is when i move the parent its corresponding child is moving nicely, but when i trying move the child it moving independently, but what i need is i want to disable the child movement or parent also move with child.. kindly suggest me how to do thisthanksvahi Quote Link to comment Share on other sites More sharing options...
RaananW Posted May 6, 2015 Share Posted May 6, 2015 Hi Vahith, this is the correct behaviour of child-parent meshes. If you don't want to move the child independently, you would need to move its parent instead. so, instead of setting mesh.position , set mesh.parent.position (or better, use the mesh.parent.translate function).I am not sure if there is a "disable" mechanism for positioning, you will just have to pay attention to the parent-child relationship. maybe something like this:var newPosition = new Vector3(...)if(mesh.parent) { mesh.parent.position = newPosition;} else { mesh.position = newPosition;}? vahith 1 Quote Link to comment Share on other sites More sharing options...
vahith Posted May 6, 2015 Author Share Posted May 6, 2015 hi RaananWthank you for your suggestion :-) 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.