Thanks everybody for replying. My first problem is my model itself. In the editor, I chose "Polymesh". Like MrShawkly said, they are problematic. I also read that the "Polymesh" react as if it has a mass of 0. Which is not good. So first thing I did, I change the "Polymesh" to the "ConvexHull".
Second, when I was rotating the foosmen, I rotated the object itself. Unfortunately, rotating an object by itself does not affect the physics of the game. So I had to change the waythe rotation was done. This was more complicated than I though. Before, everything was controlled through a pivot, to which all the foosmen on the same rod were attached to.
Now I have to individually assign a script to each foosmen, even if they are on the same rod. (I wish I could assign the script to the pivot, but it does not work) That script creates a joint.Hinge for each object. And in the UpdatePhysics function I had to use a script like this:
-- if X has changed
if currentMousePos.x ~= self.lastMousePos.x then
-- calculate difference
local diff = currentMousePos.x - self.lastMousePos.x
-- calculate new rotation
self.angle = self.angle + diff
-- set the angle and speed so that movement is quick
self.joint:SetMotorSpeed(diff * 60)
self.joint:SetAngle(self.angle)
self.joint:EnableMotor()
else
self.joint:DisableMotor()
end
Sometimes the rotation angle is wrong (I have to work on this), but now when a foosmen turn, it can come in contact with the ball.
Now I have to figure out a way to move the foosmen laterally as well. I am presently trying with a slider. But it gives me a bit of problem and I do not know if I can combine both the slider and hinge on the same object.