Closed meyerzinn closed 7 years ago
After re-evaluating my system this is no longer necessary.
Cool. If someone else looks into this, the answer follows.
Each body has an id
property which is used internally in the World to keep track of various things. Therefore it should not be modified.
body.id = 123; // Don't do this
An alternative is to use an own property name:
body.myCustomId = 123; // OK
(If you really want to modify the id
property you can set it to an integer before you add it to the world. Make sure the id is unique among the other body id's in the same World)
In the game I'm developing, I have a separate entity ID system. Is there a "supported" mechanism to override the ID of a body, or do I just modify the property and hope for the best?