Hi, is it possible to change type of phisical body in function onEnterFrame()
For example I want to stick 2 objects like at this preview:http://www.freeimagehosting.net/d149f
I detect collision but don't know how to stick it...
Have you any ideas how to solve this solution?
You need to create weld joint to stick them together.
Dynamic Object - actors.body
Creation weld joint on collision enter:
Expression IsLocked == false
When I use this code "onButtonPress" - than it works, else - fatal error..
Works not so well! help to find my error
Box2d locks the world while it dispatches events BEGIN_CONTACT, END_CONTACT, PRE_SOLVE and POST_SOLVE. And if the world is locked, these functions give assertion:
For your case, the solution is to create your joint outside of these events. (For example, you can set a flag and check this flag on ENTER_FRAME and if it's true create your joint)
I mean set a flag on onBeginContact function and test this flag on onEnterFrame, if true create your weld joint.