hii, i'm new to unity ,i want make a prefab cube which is freely rotate with custom speed. how can i do it.
is there any inbuild function in unity to rotate object.?
hii, i'm new to unity ,i want make a prefab cube which is freely rotate with custom speed. how can i do it.
is there any inbuild function in unity to rotate object.?
function Update()
{
transform.Rotate(0,0,0.1*Time.time);
}
rigidbody.AddTorque(Vector3.right * 10);
– anon16754120wow.. but i need to stop them aftr some rotation .then?
– anon62947158rigidbody.isKinematic = true;
– anon16754120it stop the rotation of object this will disable the physics properties where ever you want to stop rotation use above code
– anon16754120You can to use mouse position to stop rotate, if the mouse position is equal prefab don't rotate... if diferent rotate... is a idea!
– anon56533089