- Home /
Sphere "skids" on turns without rotating
I'm using the accelerometer from the iPhone to move a sphere, but sometimes the sphere "slides" across the floor without ever rotating, especially on sudden turns.
I've found threads that deal with my problem, but I'm still lost. My exact problem is addressed here:
http://forum.unity3d.com/threads/95446-Rigidbody-Sphere-skids-around-how-to-stop
The solution appears to be setting rotation of the sphere = to its position... But how do I do that?
Answer by stingman · Jul 09, 2012 at 10:45 PM
function Update() {
transform.Rotate(Vector3.Right*Time.deltaTime, Space.Self);
}
is probably what you need. Vector3.Right is just used as an example direction... I don't know how you want it to rotate exactly. Space.Self applies to the object's local rotation and Space.World applies to the rotation in World Space. The code is the same in C#