What would be the best way to prevent room clipping

godot 4.2.1

making a Doors/Pressure style game here on godot, got the basics down except for:


preventing room clipping!!!
anyone know a good way to go about not letting that happen?
current code:

func _generateroom():
	#array of rooms to make
	rooms = {
		0: load("res://Room_recration.tscn"),
		1: load("res://test_room.tscn"),
		2: load("res://corner_room_test.tscn"),
		3: load("res://test_corner_that_goes_the_other_way.tscn")
	}
	#selects the room and adds it to the parent scene
	new_room = rooms[randi_range(0, 3)].instantiate()
	parent.add_child(new_room)
	new_room.global_position = endpoint.global_position
	new_room.rotation = endpoint.global_rotation

There’s not enough information to answer your question. For one, can you show the what the room scenes look like?

What I think may be happening is you are using plane meshes as walls for the room and the surface of the plane meshes only show on one side because of UV mapping. If this is the case (I’m only guessing), you’d need two sided planes or perhaps more convenient, a 3d mesh that has minimal thickness.


I’m thinking of trying to use a few long Raycasts and area 3Ds, in order to rig the rooms to correct themselves preemptively, but idk what the code for that would be exactly.