why does square gets instantiated twice even single collision?
all = GameObject.FindGameObjectsWithTag("box");
foreach (GameObject c in all) {
if (collision.gameObject == c)
{
Destroy(c);
Instantiate(square, new Vector3(a, b, 1f), Quaternion.identity);
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612120903im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Changing light color between players when they collide (BOLT) 0 Answers
Problem replaying exactly same movement 1 Answer
How do I get nav agents to not collide with each other? 0 Answers
How do i make game objects return to their original position after collision? 2 Answers
Recreating 'skin width' functionality on a rigidbody? 0 Answers