Combining 2 primitives to create new primitive shape

Is there an editor script that i can use to take 2 primitives and generate a new primitive shape from them?

The reason i want this is two combine the two colliders together into one.

I have collision code that makes a hit sound if an object collides with it, but that means that if a rolling ball is rolling from one floor to another, the collider registers a hit when visually there shouldnt be one since its looks like one seamless floor. Since i sometimes need a floor to be narrow at one point and wide at another, the only way i can do it now is to just make 2 floors and vertex snap them together, but this gives me the problem i mentioned above.

I essentially have 2 cubes vertex snapped together. They have been stretched into floors and they both have colliders. A hit sound occurs when an object hits the collider at a high enough velocity. It also bounces because of the physic material.

The problem is that if i have a ball rolling from one floor to the next, then i get a bounce and hit sound when there shouldnt be one. Therefore im trying to somehow combine the colliders of the floors, and the only way i can see it now is too combine the cubes into one mesh with one collider, but i need help with this please, thanks.

EDIT 2: I looked at various other questions but it’s just not clear how to combine 2 primitives into or at least their colliders. PLEASE SOMEONE PROVIDE SOME INPUT!!!