1
\$\begingroup\$

I have a crude rectangle sprite with a box colider 2d, and a circle sprite with rigidbody 2d and circle collider 2d, as seen in the image below. When I click on the red rectangle, it moves up fairly quickly a little more than the diameter of the circle.

Game image

If this occurs from the position show, or with the circle any further right than it currently is, the circle appears to fall down onto the yellow box almost instantly, hugging the side of the red rectangle. If I let the circle go a little more onto the red rectangle then it is pushed up correctly. Why is the circle falling off the red rectangle from this position, and how can I prevent it from acting like this?

\$\endgroup\$
  • \$\begingroup\$ "it moves up fairly quickly" - how fast are we talking? Is it possible that the time-step that Unity's operating on with respect to collisions is too large? I.e. by the time a collision is checked the circle collider is already in the rectangles' box colliders? You can try slowing down the motion to see if that might be the case. \$\endgroup\$ – derstander Mar 19 '17 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.