Hello! I use this snippet to generate a Body
and add to it the World
. I add three bodies at program startup, which get correct BodyID
. But when I attempt to add a body during runtime, it creates the body, but with the BodyID
of 0
, which then affects the collision detection. Does anybody know ho this can be solved? (I tried setting the BodyID
manually, but it says, that the setter is unaccessible). Thanks for help
...
Body temp = BodyFactory.CreateRectangle(pWorld, bd.width, bd.height, bd.density);
temp.SetTransform(bd.postition, 0f);
temp.BodyType = bt;
temp.OnCollision += OnCollision;
...