Hello. I am highschool student in korea. i need your help about Unity3d.
I’m developing an app.
but i have a problem.i want to roll cube Object. If i use “rotate” in JavaScript, it rotate the position of itself. But i need to roll like the eraser rolling.
Would you help me,please?
Try adding a rigidbody to it, and then use
rigidbody.AddTorque(some Vector3);
or
rigidbody.AddForceAtPosition(some Vector3 force, some Vector3 position);
Both of these will create a realistic-looking roll.
If you just put your object on a steep hill, that should make it roll as well, provided you have both a rigidbody and a box collider of the correct shape on it.
Thank you. As i use AddTorque , i can sole this problem.