I can’t find documentation on what might have changed under the covers, or anybody reporting a similar finding, but apparently sometime in the last month, an update to unity web-player has drastically changed the functionality of a game I published a few months ago.
In this game you throw objects, and right after they are instantiated, I give them a torque:
newobject.rigidbody2D.AddTorque (Random.Range (-700f, 700f));
Originally this would have resulted in the items rotating at most maybe 360 degrees per second, but now they are rotating incredibly fast, and it makes my game pretty unplayable.
The new web-player matches the results I have found playing this game in the new unity editor, so I could potentially just correct the problem for the new player, However, I’m not sure this is the best approach. I’d like to know what is working differently.
Previous web-player was 4.5.2
previous editor was 4.5.1
I have upgraded to Unity 4.5.5f1 web player and editor.
Any insight would be helpful. Thanks.
i encountered similar issues and just the same was unable to find the direct cause, instead compromised and resorted to applying the torque relative to the initial mass(rigidbody.mass) of the object this way my objects recieved torque relative to there rotation, hopefully its applicable to your situation i searched for what seemed like days before concluding that there was no information on why this issue arose in the first place.
rigidbody.AddTorque(transform.forward * rigidbody.mass * rotationalforce);
hope this is useful.
Thanks for the feedback, guys. It is reassuring to finally hear that there are others who have found this undocumented change - it is frustrating. I eventually caved and adjusted my game.
Skylem, your solution is probably the right approach. In my case, there was only 1 prefab I was using the code on, and they had a mass of 1 :P. I guessed at 1/100 the ooriginal force, and I was close, so I just hard-coded a new value. If it helps anybody, in this case, with a mass of 1, I found that the difference in force changed my range from +/-700 to +/-5.