- Home /
Sphere on cube floor doesn't rotate after too much delay
I made a simple area where you rotate the actual ground to roll a sphere around. If you start rotating (by using WASD) immediately then everything is good and the sphere rolls fine. But if you wait for a second or two after the ball falls onto the ground of the area and try it, the ball stays still and the floor phases through it as you rotate the ball.
Here is a picture of the ball and the area


The second pic is what happens if you wait a few seconds before rotating the ground. The ball is stuck in the same place. If I kept rotating, the ground would go through the ball until I mess with it the the ball would roll on the underside of the ground.
Here is the script I'm using to rotate the ground.
using UnityEngine;
using System.Collections;
public class moveGroundScript : MonoBehaviour {
public int speed = 35;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.A)) transform.Rotate(Vector3.forward * speed * Time.deltaTime);
if (Input.GetKey(KeyCode.D)) transform.Rotate(-Vector3.forward * speed * Time.deltaTime);
if (Input.GetKey(KeyCode.W)) transform.Rotate(-Vector3.left * speed * Time.deltaTime);
if (Input.GetKey(KeyCode.S)) transform.Rotate(Vector3.left * speed * Time.deltaTime);
}
}
The ball has a rigidbody component with a mass of 1 and the problem only happens when you wait before rotating. Can someone please tell me what is happening and how to fix it? Thanks.
$$anonymous$$y first idea was that the physics materials of the ball and/or the floor probably have a very high static friction. I haven't tested that, so it is just a thought. :)
Answer by ToothPaste17 · Jul 25, 2016 at 11:55 AM
The problem can be fixed by adding a Rigidbody component to the floor and setting it to be "Is Kinematic"
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Multiple Cars not working 1 Answer
Rotating following camera for a sphere 1 Answer
object placement on sphere, rotation deform 1 Answer
Rotation Stutters 1 Answer