Ceiling crash? Why?

Well, you finally got me… I am confused :slight_smile:

Why when adding the walls and ceiling is the crash_sequence called? There is a conditional in the code that needs to see the tag “Hazard” to trigger it, so I am confused why it’s working without those CSGBoxes having those tags… ?

I thought maybe they were copied from the floor, but they were not. They are empty.

Help! :slight_smile:

Hi Bill,

thats a wierd one, yeah collisions will work on the CSG boxes as the collision checkbox is selected.
but for the crash sequence to play, it should have that Hazard tag set.

can i have a look at your scene tree with all the CSG boxes please.

and a quick look at your player script for the _on_body_entered

cheers
Darren

1 Like

Thanks Darren!

Below find the scene tree, with both the original “Floor” selected (I renamed in Environment) and then the first “Wall” selected… so you can see the Node inspector over on the right.

When duplicating the initial Floor CSG box, it did not carry over the Hazard tag, which makes sense that it wouldn’t… what doesn’t make sense is why the script still acts like it did :slight_smile: Thanks for any help!

func _on_body_entered(body: Node) -> void:
	if is_transitioning == false:
		if "Goal" in body.get_groups():
			complete_level(body.file_path)
		
		if "Hazard" in body.get_groups():
			crash_sequence()
		
		print (body.get_groups())


Oh, does it inherit the tags from the parent, even without the tags being visibly present on the child objects? Which if so would be hard to keep track of and debug… hmmm

Think i read the initial question wrong, apologies for the confusion there, i thought they might have been separate, sorry.

if the main parent is a CSG shape of some sort and children are CSG shapes, like you have here for the environment, the Hazard tag gets inherited to all its direct CSG shape children.

CSG shapes are good for prototyping levels as they can be used in a sort of subractive or additave way, its my understanding that the different CSG shapes combile together in the end to create new geomerty, so we would essentially have the parent background CSG shape having all the sub CSG shapes all combined together into one mesh object and thats why just having the hazard tag set on the parent works.

just as a test to see what i mean, in your environment scene, if you select one of the CSG boxes that intersect another one, if you drag it around a little, you will see the lines that form the geometry change, so that it can create the single mesh from all the different parts. as opposed to being just cubes that just intersect into each other

Hope that sort of answered your question there.

Darren

Thanks Darren… The thing is, as illustrated in my images, the Hazard tag (nor any tag) does not up in the Nodes/Groups panel of the child. If it is inherited, which makes sense, it should be there visible in the panel, no?

I guess imagine if any property the inspector should represent that inheritance, rather than leave it blank. Are we really saying it’s being left blank but has the tag anyway? How would we know or have proper reference? :slight_smile:

Edit: I do see what you are saying, in that it may be seen all as 1 piece of geometry… I guess it’s something I need to get my head around!

i done a little testing and honestly, i cant say for definite whats happening behind the scenes so to speak. i tested another parent/child combination of say a node3d and children and the groups didnt propogate through.

it may be different in later versions, but my understanding was that the group tagging is done at the scene tree level, so child nodes dont automatically inherit their parent group tags.

its more a parent / child relationship with regards to scene tree positioning and their relative Transforms, as opposed to inheritance.
i do just think that the CSG is abit of a unique case for this particular one as it combines using the boolean type operations (defaulted to union). i had thought initially that this might have needed to use the CSGCombiner node.

that was pretty much my take away from what i understand. would be good if anyone else reading can shed any other lights on it as well

Darren

2 Likes

Ok thanks Darren! I am going to do some testing myself, just to make sure I understand what’s going on… !

1 Like

Hi Bill,

I’m not 100% sure on the logistics of it but i can pull on a thread and make some guesses on this.
When we create the environment we do have multiple csg boxes and only that parent object has the group “hazard”.
Now if we used this as our scene then quite rightly only the floor would be affected by that group.
What i think is happening is when we instantiate that scene we have what we call uneditable children so in that case it is merged into one object and so does take on the properties of the parent object.

To sum up
Its a little unclear on it but i think this is what is happening and using the instantiated scene in our level makes it one object node so it takes on the properties of the parent node as it is just one object in the scene.

Hope this clarifies

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms