Construct 3 r297

You're viewing a single comment in a conversation. View all the comments
  • 1 Comments

  • Order by
  • The wall sliding doesn't cancel the velocity along the normal of the contact. The result is the walls can seem sticky and make the object jump around corners.

    I don't have a login to the bug tracker or idea platform but here is how I've done it with event based wall sliding. As long as you get the collision normal you can calculate the normal velocity(vn) with a dot product. We only need to cancel the velocity going into the solid so min is used to get rid of the velocity going away.

    vn=min(0, vx*cos(normal)+vn*sin(normal));

    vx-=vn*cos(normal);

    vy-=vn*sin(normal);