0
\$\begingroup\$

I'm currently trying to learn some Physics2D in Unity. Now, I've created a Ball (sprite) and added a RigidBody2D and a CircleCollider2D on it.

The RigidBody2D has the following settings:

  • Bodytype: Dynamic
  • Simulated: true
  • Use Auto Mass: false
  • Mass: 1
  • Linear Drag: 0
  • Angular Drag: 0
  • Gravity Scale: 25
  • Collision Detection: Continous
  • Sleeping Mode: Start Awake
  • Interpolate: None

Now, when I start the scene, the ball drops as expected. However, it's also moving on the x-axis by ~83 pixels, which I don't want. The movement on the x-axis stops once it reached that ~83 pixels point.

If I freeze the x-position in the Rigidbody2D-Settings I get the intended behaviour (ball just dropping on y-axis), but I feel like that would be a hack instead of fixing the actual problem.

What could cause this? I expected the ball to just drop, if I have no drag, a certain mass and gravity enabled.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

Found the solution. The object was colliding with the background it seems.

\$\endgroup\$
2
  • \$\begingroup\$ Next time, try to reproduce the problem in a new empty project first. That will ensure that the information/instructions you include in your question are sufficient to reproduce it and diagnose a cause, and will often help you isolate the problem yourself in the process. \$\endgroup\$
    – DMGregory
    Commented Jun 1, 2019 at 12:31
  • \$\begingroup\$ Please accept your answer. \$\endgroup\$ Commented Jun 2, 2019 at 9:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .