Search the Community
Showing results for tags 'parent-child'.
Found 2 results
Parent-Child rotation and Box Collider of Child Problem
ian posted a topic in Questions & AnswersHi I have some problem with collider of child box. If we set parent box and add child box. If Child have its box collider, and if we rotate parent box, child is changing (potition and rotation), but child's box collider is not changing (position and rotation). How should we achive that box-collider will follow child when we (rotate or maybe change position of parent). Here is example of what I am talking about. (here is grid-box seen as box-collider of child-box. and grid-box is not changing position and rotation). http://www.babylonjs-playground.com/#MBFUI#9 (or mybe http://www.babylonjs-playground.com/#MBFUI#8 - here we can se grid-boxes as colliders and blue box is rotation and changing position but it's box-collider is not) How can/should we repair code so that box-collider is folowing its child's box-mesh? Greetings
David78 posted a topic in Questions & AnswersThese are two simple questions, regarding parent-child relationships. It's not that I don't get this: " Any postion, rotation and scaling transformations made to the parent... prior to assigning it to children... will also be applied to the children when the parent is assigned. " What's happening rather is that when I load two meshes and make the first one the parent of the second or vice versa, there is an initial displacement in the child's position. On loading the meshes, this is the only line of code involving them, the rest sets up the camera, lights, etc: newMeshes.parent = newMeshes;Which results in newMeshes being displaced. When newMeshes is moved after this it works fine, whatever transformations are done on it are also done to newMeshes, the issue is this initial displacement. The second question is whether parent-child relationships can be defined between specific parts of a mesh and another mesh. For example, say a human-like mesh is loaded that has skeletal animation where one hand moves up and down, and I want a sphere or another mesh to also move based on the motion of this one hand and not of the entire body. (Without using sub-meshes) how can this be done? Can a mesh be attached to the motion of skeletal animation? Still a noobie learning the ropes... Thanks in advance.