Hi guys, my first post!
I've started playing with Gideros and so far it's been plain sailing. That was until the point I needed to reference an Box2D body by its name. It seems Box2D has a world.getChildByName() method, which I can't seem to find a reference to in the Gideros Physics API.
Is this a missing feature, or is there another way I can reference an arbitrary body based on its name?
To give a bit of context, I have two bodies, one which contains a sensor fixture, the other a kinematic fixture. When the game character touches the sensor fixture I want to:
- Remove the sensor fixture (done)
- Add velocity to the kinematic fixture
Since the kinematic fixture is not actually part of a collision, I need another way of referencing it. Hope this makes sense.
Nic.
Comments
I see,
usually I either create a class for an object, store them as class properties and add class instance reference to bodies (or fixtures)
as
Thanks for the response, that makes perfect sense, and feels a bit cleaner since you'd be able to call the second object immediately without any searching.
The thread I found mentioning .getChildByName() was on the Box2D forum where they remove a second object with this code (I'm not allowed to post links, but a google search should get you there):
Nic.
Likes: ar2rsawseen
http://members.giderosmobile.com/knowledgebase.php?action=displayarticle&id=41