Avoiding intersecting objects
In Unity, to specify that an object should participate in the Unity Physics system, you must add a Rigidbody component to the GameObject. Adding a Rigidbody gives an object mass, velocity, collision detection, and other physical properties. We can use this to prevent objects from intersecting. In many games and XR apps, Rigidbody is important for applying motion forces to objects to let them bounce when they collide, for example.
In our project, if a picture collides with another picture, it should simply move out of the way so that they're never intersecting. But it should also stay flush with the wall plane. Although a Rigidbody allows you to constrain movement along any of the X, Y, and Z directions, these are the orthogonal world space planes, not the arbitrary angled wall plane. In the end, I decided to position the picture manually when a collision is detected rather than using physics forces. My solution is to constrain the position (and...