In effort to build a racing simulator, I have been working on a working model for the pistons in the engine, and have come to a bit of a stand still.
I have gone through extensive testing, through which we have "dumbed down" our prototype, in efforts to localise the actual problem.
We have a wheel, represented by a basic cylinder. I have added a second cylinder as a sort of knob, which allows us to run the system, and easily visualise its spin, using the following line;
Throughout various tests, a common observation is that the wheel does not appear to spin correctly. Using a collision plane to derive rotations per minute, we have determined that at a certain "thrust", the wheel reaches its maximum speed. Past a value of approximately 'thrust = 5,000', the wheel will not increase its speed. At present, this gives us a rotation of approximately 60 rotations per minute. Ideally, we want to be able to reach the breaking point of about 10,0000.
rigidbody.AddTorque(transform.up * Time.deltaTime * rotatioonSpeed, ForceMode.Acceleration);
What causes the rigidbody to 'cap' its force? Everything is at default, as per various tutorials we have explored; As far as we have looked, various values might have an impact, but not to the point where speed hits a maximum on its own merit.
Incase it matters, a some extra information about the system:
- We are not yet using conventional Unity measurements. While to scale, the pistons are quite larger then normal, with the cylinder housing the piston holding a length of approximately 2 meters.
- Once "thrust" exceeds the maximum allowance to impact on speed, the value appears to weigh on breaking force, instead. Prior to reaching maximum speed, the user needs to "push" on the opposite direction, to reverse the rotation. It can take a second or two before the wheel slows down, and reverses its direction. The further past this maximum we go, the quicker the engine will immediately move in the reverse direction.
- There is nothing else imparted on our model for this behaviour to take place. We are literally dealing with a wheel with a joiner pin on the side.
As stated, tutorials we have viewed tend to suggest that the values in the rigidbody should not effect the behaviour, this early. That said, here are our values:
Mass: 1 Drag: 0 Angular Drag: 0.05 Use Gravity: False Is Kinematic: False Interpolate: None Collision Detection: Discrete Constraints: FreezeRotationYZ
My best attempts to find a similar problem online ironically reaches a bunch of articles on users attempting to enforce a maximum speed. For best results within scope, we would hope to be able to reach infinite speeds, and separately work out whether the speed of our wheel would cause a major fault, in turn limiting the speed it would potentially reach in practice.
Personally, I suspect that the size of the object would make a difference, as unity perceives it. Another member on my team argues that because the rigidbody uses relative values, size should not make a difference. Unfortunately, this is as far as we can get in localising the problem.