Search code examples
ioscocos2d-iphonelevelhelper

How to retrieve makeStatic or makeDynamic methods in LHBezier? LevelHelper - Cocos2D


In the LevelHelper, I am able to set bezier shapes to static, dynamic etc. In my code, I am in need of changing these properties. Can someone please help me with that?

LHBezier* bezier = [loader bezierWithUniqueName:@"BezierNode"];

[bezier makeStatic]; // not working

Solution

  • You can change body type like this:

    bezier.body->SetType(b2_staticBody);
    bezier.body->SetType(b2_dynamicBody);
    bezier.body->SetType(b2_kinematicBody);