Part Can't Spawn In Other Parts

Hello, so this is what I have right now
–Video–


so this is what happens at the moment parts can spawn in other parts but I dont want this so is there a way to fix that?
if yes pls tell me.
Have a great day.
(What I Want: when parts would spawn In other parts a error message appears and they dont spawn)

Try WorldRoot:GetPartsInPart I haven’t used it myself yet but I think it could help you. :slightly_smiling_face:

You could try using raycasting and cast a ray in the area you want to spawn the part. If there is a part there, print the error message and stop. If not, put the part there.

do you have a script to show this because I am bad with using raycasts

local raycastParams = RaycastParams.new()
			raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
			raycastParams.FilterDescendantsInstances = {v, game.Workspace.Terrain, game.Workspace.carSpawnRoad, workspace.Baseplate}
			local origin = Vector3.new(v.Position.X, v.Position.Y + 10, v.Position.Z)
			local rayResult = game.Workspace:Raycast(origin, Vector3.new(0, -20, 0), raycastParams)
			if not rayResult then
				placeToSpawn = v.CFrame
				break
			end
		end

This is a fragment of a car spawning script I made. As you can see, it gets the spawn part and adds 10 to the Y axis and ignores all the parts around it that it does not need to check. I hope this helps.