Adem Posted January 8, 2017 Share Posted January 8, 2017 hy guys, i have problem with the mesh going in the specified direction, the bullet in this code goes along x axis :- BABYLON.SceneLoader.Load("Building/", "Building.babylon", engine, function (scene) { // Wait for textures and shaders to be ready scene.executeWhenReady(function () { //bullet var bullet = BABYLON.Mesh.CreateSphere('bullet', 3, 0.5, scene); var sphere2 = BABYLON.Mesh.CreateSphere("sphere1", 16, 0.5, scene); bullet.position = new BABYLON.Vector3(0, 0, 0);; bullet.parent = sphere; sphere2.position.y = 2; sphere.parent = scene.activeCamera; sphere.position = new BABYLON.Vector3(0, 0, 1); scene.registerBeforeRender(function () { bullet.position.z += 0.05; }); Quote Link to comment Share on other sites More sharing options...
gryff Posted January 8, 2017 Share Posted January 8, 2017 @Adem: I have no idea what you are trying to do with this code but I don't claim to be a great coder . But let us look at what you have written : 6 minutes ago, Adem said: the bullet in this code goes along x axis but your code has : bullet.position.z += 0.05; Then let us look at your other code: 8 minutes ago, Adem said: bullet.parent = sphere; sphere2.position.y = 2; sphere.parent = scene.activeCamera; sphere.position = new BABYLON.Vector3(0, 0, 1); Where is this sphere defined in your code - not sphere2 - sphere? cheers, gryff Quote Link to comment Share on other sites More sharing options...
Adem Posted January 8, 2017 Author Share Posted January 8, 2017 @gryff Oh that was a typing error, but it's still not working BABYLON.SceneLoader.Load("Building/", "Building.babylon", engine, function (scene) { // Wait for textures and shaders to be ready scene.executeWhenReady(function () { //bullet var bullet = BABYLON.Mesh.CreateSphere('bullet', 3, 0.5, scene); var sphere2 = BABYLON.Mesh.CreateSphere("sphere1", 16, 0.5, scene); var sphere = BABYLON.Mesh.CreateSphere("sphere", 16, 0.5, scene); bullet.position = new BABYLON.Vector3(0, 0, 0);; bullet.parent = sphere; sphere2.position.y = 2; sphere.parent = scene.activeCamera; sphere.position = new BABYLON.Vector3(0, 0, 1); scene.registerBeforeRender(function () { bullet.position.z += 0.05; }); Quote Link to comment Share on other sites More sharing options...
gryff Posted January 8, 2017 Share Posted January 8, 2017 Ok the X was a typo . But "sphere"that you parent the bullet to and then make it a child of the active camera? I suggest you make a playground and show us the full code in it. cheers, gryff Quote Link to comment Share on other sites More sharing options...
Adem Posted January 8, 2017 Author Share Posted January 8, 2017 @gryff http://www.babylonjs-playground.com/#11BH6Z#194 Quote Link to comment Share on other sites More sharing options...
Adem Posted January 8, 2017 Author Share Posted January 8, 2017 @gryff http://www.babylonjs-playground.com/#11BH6Z#195 Quote Link to comment Share on other sites More sharing options...
Adem Posted January 8, 2017 Author Share Posted January 8, 2017 @gryff any update? Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 8, 2017 Share Posted January 8, 2017 Adem - please be careful about keeping on pinging someone. We all volunteer to help when and if we can. Our time is given freely and with grace but we are not at anybody's beck and call. If you behave as if we can be summoned as and when you need us you will end up alienating those who would help you. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 10, 2017 Share Posted January 10, 2017 Because your parenting the bullet to the sphere the sphere to the camera maybe? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 10, 2017 Share Posted January 10, 2017 P.s. If you are starting to agitate people more then I do on this forums then it would be best to slow your roll. Honestly if I was a moderator I would have prolly given you a content warning two weeks ago with that splurge of repeat threads. But that's non of my business... anyways... what i I am seeing with you bro is a lack of direction and guidance. Soooo as much as it does not excite me send me a private message let's get you on track and on a set development path with a project list for you to complete so you can gain the general competence needed to start doing something with the engine. Think of it as a private tutorship. But do not take this as me adopting you. It's going to be on you to figure out what I assign you and I will make sure you have all the information and resources at your disposal to learn correctly. But like I said it will be on you to learn I'm not gonna hold your hand but I will point your head in the right direction. Balls in your court msg me if your down if not then just ignore this, but I would recommend not continuing to rub people's feathers (unintentionally I know) in this manor. Peace out, sincerely WuWong GameMonetize and Adem 2 Quote Link to comment Share on other sites More sharing options...
adam Posted January 10, 2017 Share Posted January 10, 2017 15 minutes ago, Pryme8 said: Honestly if I was a moderator I would have prolly given you a content warning two weeks ago with that splurge of repeat threads. If I was a moderator, I probably would have done the same for you. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 10, 2017 Share Posted January 10, 2017 Eh, little to no f***s given I make moves and get people talking and have helped more people then most so your constant pretentious attitude tword me can jog off. btw I like you a lot @adam and enjoy reading your script I do not understand why more often then not your general attitude with me is kinda pissy. sorry if I ever rubbed you wrong but I'm just doing me. And if any moderator has ever felt inclined to warn me for any of my content I would adimatly support them and maybe learn something from being reprimanded. But as it goes I talk to the moderators, and as far as I know though I annoy them at times but word on the street is people think I'm harmless so... much love for calling me out though everyone deserves to be checked. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted January 10, 2017 Share Posted January 10, 2017 Mostly harmless Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 10, 2017 Share Posted January 10, 2017 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.