How would you make a system where if i clone an instances it spawns above other instances instead of clipping through them?
For example i make a randomizer where every random interval an anchored instance is created. How would i make it so that if theres is a part say like a slope or just a regular cube instead of spawning in the cube it instead spawns above it.
Basically, try firing a raycast facing upward in the instance/party that was made before which will act as a reference to the next location the clone would be spawn. You would whitelist the part(so it would only detect the part) and once it detects the surface, you can add a distance from there like a few studs and let that be the position that the clone would be spawned to next. By either using origin position or CFrames, depending on your preferences.
For the mechanism of having random intervals, incase you don’t know, you could use math.random. eg. math.random(1,10) – gives a random number from 1-10 which will act as the seconds left for the next clone.