Hello, I’m making a Pachinko game. I tried to update the score by having the ball fall down and collide the scoreboxes at the bottom. Can you please check my code using OnTriggerEnter?
The scoreboxes are triggered as well in the inspector box.
public void OnTriggerEnter(Collider ball)
{
if (ball.gameObject.CompareTag(“ScoreBox0”))
{
UpdateScore(0);
Debug.Log(“0”);
}
if (ball.gameObject.CompareTag("ScoreBox50"))
{
UpdateScore(50);
Debug.Log("50");
}
if (ball.gameObject.CompareTag("ScoreBox100"))
{
UpdateScore(100);
Debug.Log("100");
}
}
