Borislav Posted June 29, 2017 Share Posted June 29, 2017 Is that possible? If I set it like that: face.position.x = char.position.x face.position.z = char.position.z It will just stand still. I currently have. face.position = char.position It makes the cube follow the mesh. But, I want the cube on the head, but it is in the torso. http://cityworld.16mb.com/levels/1/play/preview.html Quote Link to comment Share on other sites More sharing options...
Borislav Posted June 29, 2017 Author Share Posted June 29, 2017 I just found out I could just make the cube longer so it reaches the head. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 30, 2017 Share Posted June 30, 2017 Also, look at this... face.setPivotMatrix(BABYLON.Matrix.Translation(0, -something, 0)); That can move a face/head up or down. Also... you can try fun things like... face.position.y = face.position.y + 2; face.bakeCurrentTransformIntoVertices(); face.position.y = face.position.y - 2; Fun with pivot/origin adjustings. After you perform up/down pivotMatrix adjustments or move-bake-unmove actions like these, it is sometimes fun to animate around the X-axis. It can make you smile... scene.beforeRender =()=> { face.rotation.x += .005; } Offset rotation. Pendulum-ing. Good luck. Hope this helps. GameMonetize 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.