Behaviors issue:onCollision
mandre96

Hi,I tryed to make an behavior using this.onCollision but it did not worked.There`s no collision being detected at all.I changed to this.owner and i got an 'Cannot set property 'onCollision' of undefined' I have to make this behavior work cause I have 17 objects with the exactly same functionality And I'm madly trying to increase performace on the game.

ps:I'm also having an strange "Uncaught TypeError: Cannot read property 'minX' of undefined".

Thanks in advance.

 
All 8 Comments
mandre96

Update:The "Uncaught TypeError: Cannot read property 'minX' of undefined". wase resolved by changing one of the layers mode from 2d to webgl.

Gio

I just checked and you're right, onCollision is called for the object but not for its behaviors. This is definitely a bug - I have fixed it now and it will be in WADE 3.2.

I think that with some luck we could have 3.2 by the end of next week. I can't promise that though. However if you desperately need the fix sooner, you can change it in the source code. It's lines 56 and 57 of physics/collisions.js. They should read:

var cancelA = sceneObjectA.process('onCollision', {otherObject: sceneObjectB, contact: contact, manifold: manifold});
var cancelB = sceneObjectB.process('onCollision', {otherObject: sceneObjectA, contact: contact, manifold: manifold});

Regarding the other problem that you've managed to work around by switching the layer to webgl. That's interesting and it also sounds like a bug. If you can give us some more context on that, we might be able to fix it in time for 3.2. What do we need to do to make that happen?

 

mandre96

Thanks a ton for the physics,I will change in the source code cause I need this game working as soon as possible.

The second erros is,I have a image with set visible to false.It's a texture like image and when the game is over it fades in to an opacity of 0 to 0.2.To improve performace I tried to switch to 2d, because I'm getting some "too many webGl contexts error" but,when I did, the WebGl error didn't disapered, and I got this new error " Cannot read property 'minX' of undefined" .Gio,I'l be sending the code to you guys.In the performace post I will tell some problems that I encountered.This way we can help each other!

Thank you guys for the amazing support.

Marcos Andre

mandre96

I wasn'tn able to find the path to edit, when I email you guys,could you send me back with the right physics.js?Thanks.

mandre96

I'm not being able to send via email heres a link:http://www.4shared.com/zip/NgrLk-b8ba/HemocciAttack.html

Gio

Hi

Just to reassure you... I haven't looked at it much, but just running it with the most recent (unreleased) version of WADE made a huge difference in terms of performance. I'll have a better look and send it back to you tomorrow.

mandre96

Thank you very much Gio, You just saved my life!

Gio

I sent you a private message with the updated project (mail icon on the top right of the page when you're logged in). 

It looks like there's a bug in the wade 3.1 editor: if you keep switching layers for scene obejcts, it creates but never deletes those layers. You had accumulated quite a few and that was causing several problems (too many webgl contexts, and performance issues). This has been fixed and the fix will be in 3.2.

 

Post a reply
Add Attachment
Submit Reply
Login to Reply