Hi! I have MovieClip with animation of MovieClip inside. How can I join box2d with that animation (basic motion tween)?
Thanks!
First of all your animated body must extend BodyShape or one of the shapes.* classes. Then just set the component property "type" = "Animated" and Box2D will use your animation for physics.
Thanks. It works even if I set type to kinematic.
One more question - In one keyframe I resized box to 150% size, but box2d object didn't resize. How to force that object to resize?
Box2D doesn't really support resizing shapes after they've been created, so there's no easy way.
You could try calling destroyShapes() and then shapes() again on each frame. This would just destroy and recreate the shapes.
You could also try modifying the raw b2PolygonShape vertices.
No guarantee either of these will work well...