I’m trying to make falling rocks with different speeds and directions
here is the code , it is working perfectly however The rocks aren’t falling smoothly. am I missing something
gravity scale = 0
void Start () {
int MaxForce = 0;
int MinForce = 0;
switch (GameManager.Instance.mode)
{
case GameMode.Easy:
MaxForce = 10;
MinForce = 5;
break;
case GameMode.Medium:
MaxForce = 15;
MinForce = 7;
break;
case GameMode.Hard:
MaxForce = 20;
MinForce = 9;
break;
default:
break;
}
Vector2 Force = new Vector2(Random.Range(MinForce-3, MaxForce-3) * Random.Range(-1f, 1f), Random.Range(-MaxForce, -MinForce));
GetComponent<Rigidbody2D>().AddForce(Force,ForceMode2D.Impulse);
}