1

I have a 2D player sprite, controlled like the player in "asteroids". (rigidbody2d; boxcollider2d; movement controlled using AddForce/AddTorque for translation/rotation; rotate;accelerate/brake)

It moves along a racetrack which also has a Collider2D. If the player touches the wall (edge), it turns to face the wall and the forward motion stops of course (driving straight into the wall).

How do I make it so that the player slides along the wall, maintaining forward motion? Rather than rotating to face the wall and stopping.

Tried circlecollider, modifying the shape of the boxcollider (to be longer in the direction of motion) and also played with materials.

jqwha
  • 1,599
  • 6
  • 21
  • 32
  • Have you tried modifying the physics material of the wall? – Max Yankov May 09 '15 at 22:00
  • I tried things like reducing friction to 0, etc. on both the player and the wall. I also tried making the collider a "hexagon" so that the front and back are points, with straight sides on the left and right, but of course the player slides along the wall on the closest straight edge so it's not exactly what I need :( – jqwha May 13 '15 at 05:57

0 Answers0