- Home /
What factors have an affect on the AddRelativeTorque()?
I am using AddRelativeTorqe() to rotate an object using a given force. I had this working just fine. After making some script changes (improvements to classes, etc), which resulted in me creating a new game object and attaching the necessary scripts, I found that the amount of force use was no longer sufficient to rotate the object at the required speed. It's much slower to rotate. What ever it is, it did not affect AddRelativeForce().
The values and function calls are the same. The functions are called as expected and are supplied with the correct force to apply on the torque. The mass is also the same, even though this has no direct affect on torque in the unity physics engine and I apply the force using an Impulse. I could only assume this is being affected by some editor option or such which has changes as a result of creating a new game object, as for all intended purpose the scripts before and after supply the correct values and the expected times.
To paraphrase the question, what would cause the angular velocity of a game object to be different when calling AddRelativeTorque() with the same force?
A guess -- are you calling in Update, or FixedUpdate ?
Are you using time.deltaTime in the correct way ?
That's always a gotchya. It's a difficult issue to really master.
Thanks for the suggestions, I am using FixedUpdate() and deltaTime as it should be. Its like there is an angular drag being applied, yet it is clearly set to 0.
It's highly frustrating, it's like the Physics engine has suddenly changed but Physics settings are exactly the same.