RalphEl Posted October 13, 2015 Share Posted October 13, 2015 I've found that if I use movewithCollisions with workercollisions = false, it works great else if workerCollisions = true,,,,, movewithCollisions is not moving,,,, is there something I'm missing ? if Yes,,, please tell me how to use it thx. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 13, 2015 Share Posted October 13, 2015 Work for me http://www.castorengine.com/babylon/Survival/index.php Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 14, 2015 Share Posted October 14, 2015 Should be working, just like dad72 said. Want to reproduce it somewhere? Would be great to see what's not working. Quote Link to comment Share on other sites More sharing options...
RalphEl Posted October 14, 2015 Author Share Posted October 14, 2015 Yes,, I can say its working ,, but not with clonedMesh & workerCollisions = true If I use instanced mesh its ok,,, but I need to make cloned mesh with cloned skeleton,,,,,,,,, do I need to clone collider or is there something else I need to turn on, setup after cloning to get collider working ? thx I need same skeletal characters but I need to clone them to play separate animations on them..... with instanced skeletalMesh we cant play different animations,, they are playing same animation all the time right ? correct me if I am wrong + tested with workerCollisions=false --- > works with instances & clones+ tested with workerCollisions=true --- > works with instances BUT doesn't work with cloneschecked 3 times to be sure As I saw in latest 2.3 alpha release there was bug fix with workerCollisions and instances,, maybe now this fix should be applied to clones xD strange is if I create another clone while playing game or just create only one clone at runtime ,,, collisions works if there is array of object clones to create problem is here,,,,,,,,,, for example if tell engine to create object every 0.5s --- > GOOD working. Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 14, 2015 Share Posted October 14, 2015 So the problem is with cloned objects. I'll try debugging it and see what could have gone wrong (ohh, quite a lot :-)). would have been great to have a playground scene to reproduce it, i'll try starting one. Quote Link to comment Share on other sites More sharing options...
z.attila Posted November 2, 2015 Share Posted November 2, 2015 Hi, i found a strange thing with enabled workercollisions and moveWithCollision (using latest babylonjs 2.3 alpha - downloaded today).I get an imported mesh position before call moveWithCollision, and after the call, the mesh position is the same. If i use a setTimeout, receive the correct position. I did this in registerBeforeRender event. But everything works fine, if i disable workercollisions. Is it a bug, or i missed something? Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 2, 2015 Share Posted November 2, 2015 Hi, A playground that reproduces this issue will help us a lot to solve this issue. Any chance you will find the time to do that? Quote Link to comment Share on other sites More sharing options...
z.attila Posted November 2, 2015 Share Posted November 2, 2015 Hello, of course, i can do it http://www.babylonjs-playground.com/#1D0HFF#1 I write the values to the console. Ahh, I forgot to mention, you can move the ball with A and D. And if you turn workercollisions to false, the current position wont be the same as previous. Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 2, 2015 Share Posted November 2, 2015 Ah. I see the problem. The thing is - witht he worker it all works async. The moveWithCollision function only updates the mesh's position after the function called it finished, and you can therefore not get the right result (If you need a better explanation, I will be more than happy to provide it :-) ).This is usually solved with callbacks. Now, in that particular case, there is a callback being called. It is a private function in AbstractMesh that receives the new position and updates the mesh. you COULD change that, but let me see if I can find a better way to integrate it. Just so you understand what I mean by overwriting it - http://www.babylonjs-playground.com/#P5NX1 . This will work correctly on both true and false. Quote Link to comment Share on other sites More sharing options...
z.attila Posted November 2, 2015 Share Posted November 2, 2015 Thank you for your quick response. I thought that it works async, but i was not sure in that. Sorry for that, i'm new in babylonjs. An integrated solution would be great, but if you dont have enough time, i'll try to do it (just in this case, i have to do it again, if i download a newer version :/ ). thanks Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 2, 2015 Share Posted November 2, 2015 Just added a public onCollisionPositionChange callback variable that can be set for each mesh. Quote Link to comment Share on other sites More sharing options...
z.attila Posted November 3, 2015 Share Posted November 3, 2015 Thank you, I'll try it out soon 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.