I’m a bit lost here, I’m instantiating objects that are supposed to fall and hit the top of a cube. I have 4 prefabs that I instantiate randomnly at random positions above the cube. Then they fall and some of them hit the cube and stay there… some others just cross the cube… and ignore all collisions… I have no idea what this is happening… Do you have any idea?
I’m just instantiating using the usual initialization
GameObject newInst = GameObject.Instantiate(objctList[selectedIdx]);
newInst .transform.position = position;
It happened to me once when I started and wanted to make a cup thing that can hold spheres. The reason I think it is is that once the objects move fast enough, the physics engine doesn’t detect any collisions because they pass through each other(because of the speed). I can think of 2 ways of solving this:
If the object they are falling on is a ground static type, make it a cube, and make it thicker so that it can detect the collision better
Make a raycast from the moving object to the target, once the raycast doesn’t return that it hit the target, it means it passed it and should’ve stopped (if you keep the previous position you can teleport it back to the last known position)
If your falling cubes have RigidBody attached to them, you can just change the Collision Detection from Discrete to Continuous… This should fix your problem as long as the floor they are falling towards does not move