x


An unexpected physics behavior

It's a very simple case. I have a floor object on top of which stands a ball. I'd like to be able to control the slope of the floor with mouse/game controller, so that the ball moves in any direction, based on the slope. That's easy.

The problem is that when I move the mouse quite sharply, the ball, instead of bouncing or going in any direction, as a physical ball would, literally "goes through" the floor, and falls into the nothingness. If I slowly tilt the floor, things go as expected - the balls gets moving in a direction.

Now, what am I doing wrong ?

more ▼

asked Feb 18 '11 at 04:03 PM

user-8657 (google) gravatar image

user-8657 (google)
3 4 4 7

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

well, you can check if all your objects that the ball touch are kinematic another solution could be by scripting, check if it collides with something, and if it do, check that the ball does not intersect , if it does move the ball to the point that just touch the object and does not intersect

hope this helps

more ▼

answered Feb 18 '11 at 04:13 PM

poncho gravatar image

poncho
932 2 3 14

(comments are locked)
10|3000 characters needed characters left

Set the collision detection on the ball's rigidbody to Continuous Dynamic. You can do it from script or in the Inspector.

What happens is that your ball is on top of the floor one frame and below it the next frame without having actually touched it, and therefore without registering a collision. Continuous dynamic collision detection prevents this from happening, but can be a hit to performanance.

Other fixes are to increase the width of your floor's collider or to decrease the physics timestep in the Time manager.

more ▼

answered Feb 18 '11 at 04:30 PM

e.bonneville gravatar image

e.bonneville
5.7k 100 116 165

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2163
x1868
x1787

asked: Feb 18 '11 at 04:03 PM

Seen: 936 times

Last Updated: Feb 18 '11 at 04:03 PM