Skip to content

Passing the world instance to linecast repositiones new bodies at 0,0 #33

Description

@yesitsfebreeze

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) {
   //
 }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions