Is the Sphere Passing Through the Plane in Unity 2017.1 a Bug?

  • Thread starter Thread starter thomas9059
  • Start date Start date
  • Tags Tags
    Bug
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 2K views
thomas9059
Messages
1
Reaction score
0
Hi,
Not sure if here is were i should report the bug. If you make a plane and a sphere with a rigidbody, at some specifics altitudes, the sphere goes trough the plane.
To reproduce it easily, i put the sphere 3.5 units higher than the plane and change the sphere scale to (0.2 , 0.2 , 0.2).
This also ocurs with other altitudes like 5.0, but no with 5.1 or 4.9.
 
Physics news on Phys.org
thomas9059 said:
Hi,
Not sure if here is were i should report the bug. If you make a plane and a sphere with a rigidbody, at some specifics altitudes, the sphere goes trough the plane.
To reproduce it easily, i put the sphere 3.5 units higher than the plane and change the sphere scale to (0.2 , 0.2 , 0.2).
This also ocurs with other altitudes like 5.0, but no with 5.1 or 4.9.
This is not a bug, this is how the physics engine works.

The engine works by calculating a frame at a time, so if In frame 1 the transform was above the plane and the next it was below, that's what it calculates. It has no sense of what happened in the in between, it's completely discreet physics because that's easy to calculate. (It may have an adjustable iteration setting, so it's more than once a frame, but still discreet.). Interpolating would cost way too many CPU cycles.

For fast moving object, you rely on raytracing instead of the rigid body. Use Physics.Raytrace from one point to another. If that returns a collision with something, warp the transform.position to the collision point and let the physics engine handle the calculations from there.

This is how I do things like bullets which are scaled way smaller than 0.2 and moving much faster than your ball.
 
Spent many years testing software and as newjerseyrunner says this is not a bug. A bug is more usually the software not coping with the calculatoin and falling over