Rotations don't work properly in run mode.

Hi, I am making a pinball game and need the flippers to rotate. The two solutions I came up with is using the rigidbody’s angular velocity and using the transform’s rotation.

Either way, it works decently in preview mode. However, when I build and run it, the flipper that uses angular velocity just jitters, and the flipper that uses rotation instantly rotates to the final rotation angle.

Does anybody know what the problem is and how to fix it?
Also, both of these solutions are kinda bad. How would you do flippers in a pinball game?

Thanks!

Nobody has done a pinball game?

I don’t have an answer, but a forum search for ‘pinball’ returns many hits. I’d be willing to bet you could find some useful information in there somewhere.

Sounds like an issue with your code… you would need to post code here for us to look at to be able to answer why its not working for you.

There are many many ways to rotate stuff and just as many ways to code it badly.

private var startPos:Vector3;
private var initialized:boolean = false;
function Update () {
	if(!initialized)
	{
		startPos = transform.position;		
	}
	transform.position=startPos;	
	
	if(Input.GetKey(KeyCode.LeftArrow) )
	{
		rigidbody.AddTorque(Vector3(0,-200000.0f,0));
	}
	else
	{
		rigidbody.AddTorque(Vector3(0,20000.0f,0));
	}
	if(transform.rotation.y<-0.34906585f)
		transform.rotation.y=-0.34906585f;
	if(transform.rotation.y>0.0872664626f)
		transform.rotation.y=0.0872664626f;
	
	
	transform.rotation.x=0;
	transform.rotation.z=0;
	initialized=true;
}

That’s the latest incarnation of the code. For some reason, no matter how much torque I add, it’s never fast enough. Not only that, but the behavior is different in preview mode and in Build and Run mode.
I tried using the motor and spring that comes with the hinge, but that also doesn’t work well because it starts up slowly. I need something that rotates it quickly right away. Also, I need the flipper to affect the ball but not visa versa, so I made the flipper have 128 mass an the ball 4.

Does anybody have a better way of making pinball flippers?