Hi! I am trying to create a football game where when one of the players score a goal the positions of the ball and players are all reset. how should I go about doing this? here is what I have so far:
public class Ball Script : MonoBehaviour
{
public Transform BallRespawn;
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == “Respawn”)
{
this.transform.position = BallRespawn.transform.position;
}
}
}
currently it is just the ball but would like it to affect multiple objects when the ball itself collides. any feedback would be greatly appreciated and I look forward to hearing from all of you!