How do I create a ball shape? What am I doing wrong?

I am continually getting this error:
1067: Implicit coercion of a value of type Number to an unrelated type Box2D.Collision.Shapes:b2ShapeDef.

when trying to create a circle shape, here is the code:

Code: Select all

 var wheelShape:b2CircleShape = new b2CircleShape(12/RATIO);


I have no idea what i'm doing wrong, every tutorial I look at uses this and it works, how do I get a ball rolling?
You're probably using Box2D 2.0.2, where b2CircleShape only takes in a b2ShapeDef. Box2D 2.1a is the one that takes in a radius. Switch to Box2D 2.1a, as that is better in almost every way anyhow. Most tutorials use Box2D 2.1.

If you're stuck with Box2D 2.0.2, refer to the old documentation: http://www.box2dflash.org/docs/2.0.2/reference/
jayther wrote:You're probably using Box2D 2.0.2, where b2CircleShape only takes in a b2ShapeDef. Box2D 2.1a is the one that takes in a radius. Switch to Box2D 2.1a, as that is better in almost every way anyhow. Most tutorials use Box2D 2.1.

If you're stuck with Box2D 2.0.2, refer to the old documentation: http://www.box2dflash.org/docs/2.0.2/reference/


yea that was the problem, thank you very much

Original thread: https://box2d.org/forum/viewtopic.php?t=9161