echo
echo copied to clipboard
Passing the world instance to linecast repositiones new bodies at 0,0
There is a bug linecasting. I added a new body at runtime, and if the world instance was passed into linecast, it would always set new bodies to 0, 0
public function tick(Delta: Float) {
if (!enabled) return;
if (linecastBodies.length == 0) return;
try {
var rayResult = ray.linecast(linecastBodies, /** world **/); // passing the world instance in here produces the bug
if (rayResult != null && !rayResult.data[0].inverse_normal) {
result = rayResult;
} else {
result = null;
}
}
catch (e) {
//
}
}
I just spent 3 hours trying to figure out why my bodies were getting stuck at 0,0 and not rotating. Finally pinned it down to passing the world to my linecast_all. Came here to post a bug, and see that it's a known issue. I haven't figured out what is causing it yet, but definitely have felt the issue.