I need some explanation and solution for moving multiple Gameobjects (balls) at same time.
On screen touch I detect position and direction of finger movement. At same time, I find the object I toched (if I touch some).
In phase.moved i calculate if movement is on x or y axis, and after that I move all objects in same row or column.
For moving objects I am using rigidbody.AddForce.
Problem is that object are not synchronized in moving (they havenot same speed). Also they sometimes collide with objects In other row or column which I don’t want.
@The OP: I’m not sure what you’re asking here, but I have a feeling (based on what you posted) that maybe you don’t want to be using the physics system for this. (If this is some sort of puzzle game involving spheres in rows or columns, and in which rows/columns of spheres can be shifted one way or the other, then I would not use the built-in physics system, but rather code the behavior directly.)
Sounds like you shouldn’t be relying on the physics system if you don’t want unpredictable results. Why not assign all the balls you wish reposition to a new parent gameobject (This could be instatiated at runtime or already exist in your scene). modifing the transform of the new parent will effect the transform of all it’s children. You can lerp the transform of the parent to it’s new position and apply a calculated rotation for each child based on the distance traveled. This would give the visual impression that your balls are rolling to the new destination and will also keep everything in sync. Once your done with the move detach the balls if required remove the temporary game object.