Elation
Elation
CC#
Created by TiEmKej on 5/12/2025 in #help
[Unity] Can't find bug in code, that spawns bonus objects with no collision bodies
...would be my guess anyway, seems to somewhat track with the chain reaction seen in the video
7 replies
CC#
Created by TiEmKej on 5/12/2025 in #help
[Unity] Can't find bug in code, that spawns bonus objects with no collision bodies
Thus two fruits would be instantiated at once (and will 100% collide with each other immediately)
7 replies
CC#
Created by TiEmKej on 5/12/2025 in #help
[Unity] Can't find bug in code, that spawns bonus objects with no collision bodies
Skimming through the code, looks like the ID check below can be passed twice per frame if there are three fruits colliding with each other at once (which can happen when a new ball gets created and immediately collides with two balls of its type):
if (this.gameObject.GetInstanceID() < other.gameObject.GetInstanceID())
{
return;
}
if (this.gameObject.GetInstanceID() < other.gameObject.GetInstanceID())
{
return;
}
7 replies