I am working on roulette 2d game. In which I want to move ball on wheel table.
For that I want animation like ball rotate around center at certain distance but I want during rotation ball slightly move inside towards wheel center.
Ball container object’s script has ball rotation code. Ball container game object is placed at center position in wheel and ball game object I placed at desire distance.
Now I try to add script in ball object will following code :
public class Ball : MonoBehaviour
{
void Update ()
{
if (GameManager.Instance.IsBallStart){
// transform.rotation = transform.parent.rotation;
// Quaternion parentRotation = Quaternion.LookRotation(transform.parent.position);
// transform.localRotation = transform.parent.rotation;
transform.Translate (transform.up * Time.deltaTime * 0.25f);
}
}
}
But didn’t get desire result. Please anybody give me some suggestion in this.
I am available always so if you don’t understand my question then ask me anytime.