more precision needed with physic movement

I’m working on a musical performance using the physic to generate musical patterns (see that video : Video Phase - Lumens - Balls )

This works ok during the performance because we’re not really using the Z axe and the trajectories are pretty small.

We’re working on a VR version of this and there we’re starting to get problems. In that latter, we take more advantage of the depth (z) because it’s not projected on a 2D screen. Also, because we have more possibilities and space, we use bigger trajectories.

The time the objects do the trajectories must be really precise and it’s not enough at the moment. We tried to decrease the FixedTimestep and it’s not better.

As you can see in that video (tests-precision-collisions), after two collisions (the third bounce), the balls don’t always touch the third object. We calculated that once among 10 it misses the object. In that video, we’ve been lucky because it fails only 1 time for 20 balls (0:27, 0:49, 1:04, 1:09). The objects appear to be cubes but their collider is a sphere.

Do you have any idea how to increase the precision of the physic to get always exactly the same trajectories?

I think physics engine in Unity isn’t deterministic. This means, that you may have different result for the same input.
Have you tried playing with settings described here Unity - Manual: Physics ?

Thanks Kozle. I did some stats and these parameters don’t look to improve my situation a lot. Maybe decreasing the default Contact offset improve a little, but not enough…

n=20

default contact offset (DCO): 0.001
solver iteration count (SIC: 20
11/20 = 55% of the balls doing the right path

(default)

DCO : 0.01
SIC : 7
9/20 = 45%

DCO : 0.01
SIC: 100
9/20 = 45%

DCO : 0.001
SIC: 7
12/20 = 60%

DCO : 0.0001
SIC : 7
16/20 - 13/20 = 73%

DCO : 1X10e-6
sic :7
13/20 = 65%

enable adaptive force : 9/20 = 45%

Maybe someone from Unity can help you with this.
I doubt you can set DCO or SIC to always get 100% success rate.
Maybe you should cheat here, by creating larger platforms and render it smaller(as they currently are).
Or… maybe you could calculate trajectories in advance (you’ll have to use differential equations here).

ok, I think I’ve found the thing!
When I leave the angular velocity of the cubes at 0 when I throw them, I get 100% of collision. Before, I gave angular velocity at the start to see it turning a little thinking it wasn’t changing the trajectory since the collider is a sphere but I was wrong.

thanks for the support!