i’m trying to figure out how to reset rb.velocity = direction * speed with this script:
as it stands my ball keeps getting faster and faster until the game resets
{
public AudioSource score;
public IEnumerator OnTriggerEnter2D (Collider2D Other)
{
if(Other.gameObject.tag == "Goal")
{
score.Play();
yield return new WaitForSeconds(1f);
transform.position = new Vector2 (0, 0);
}
}
}