- Home /
Adding torque on an object's axis
Hey,
What I am trying to achieve is to have a cube that rolls around an axis caused by a torque. When adding the torque and increasing its value, the rotation increases linearly. After a certain value, it seems like the rotation of cube is saturated and its not moving faster with high torque (100 and 1000 torque causing cube to rotate at same speed).
Note: I want to rotate cube using script not through animation.
I am attaching script and Inspector screenshot.
Answer by hexagonius · Nov 03, 2018 at 03:47 PM
Make sure to adjust this setting:
https://docs.unity3d.com/ScriptReference/Rigidbody-maxAngularVelocity.html
Answer by Sazails · Nov 03, 2018 at 03:55 PM
You could just rotate the object around a pivot without rigibody which is going to be more performant. add a script to the cube containing something like this:
public Transform pivot;
public Vector3 rotation;
void Update()
{
transform.RotateAround(pivot, rotation);
}
Your answer
Follow this Question
Related Questions
Guided Missile 0 Answers
Rigidbody should only torque around selected axis 0 Answers
How to stop adding torque and force when object collides with collider (or ground) 1 Answer
How do I nullify the torque from colliding but not from player input? (2D,C#) 1 Answer
Wheel jiggles on low torque. 0 Answers