Godot Project Won't Open, But Others Will

Godot Version

Godot 4.1.1 Originally, Changed to 4.2.2, but the issue persists.

Summarized Question

I was screwing around in Godot while trying to add a feature, and I set the max_contacts for a group of rigidbody 3Ds too high, now my project won’t open. Specifically, I will try to open the project, and it will load for a bit before crashing. Notably, all my other projects are fine.

Backstory

Hi! I was working on my project, and I was trying to develop a feature where physics rigidbody 3Ds go back to their original positions after a certain amount of time. However, I wanted them to only return to their original positions if they had moved or rotated a significant amount. I used velocity.length() to track this movement. However, I found the system harder to work with, as items may respawn due to dropping a very short distance from their spawn positions.

So then, I tried to change it so that the movement would only lead to respawning AFTER the bodies made contact with the floor/level geometry (which was a collision layer). For this purpose, I used an _on_body_entered for the rigid body 3Ds. However, I found that this did not work because contact monitoring was off, and max contacts was zero. I turned on contact monitoring and changed the max contacts to something like 3. This did not work, so I ended up turning the max contacts to the highest possible number while screwing around, and the project crashed…

And that same project has crashed every time I have tried opening it. Luckily, I have a backup with most features in tact (its just less clean/organized), but I still want the newer project working.

I have tried using code to change max contacts and whatnot through the file manager (in _ready(delta)) and it has not worked. I am not sure if the rigidbody stuff is actually responsible, but it seems almost certain that it is based on the timing of the crash.

So, does anyone know how to fix this issue? Any helps would be very much appreciated! Thank you in advance!

Do you mean just _ready()? It does not take an argument, or do you mean _process(delta)?

1 Like

I just meant _ready(), sorry.

1 Like

Can you try using a more recent version like 4.1.4 or 4.2.2? 4.1.1 is very old and there’s been many fixes after it (it’s almost a year old)

1 Like

if it’s a @tool script then you could remove that line from the top. If it isn’t then there is no reason for a script to crash when opening. You could also try removing some rigid bodies through the .tscn file itself in a text editor.

1 Like

My apologies, I have updated by version of Godot to version 4.2.2. Everything seems the same.

I just went to the .tscn file of the game’s level, and while the rigid bodies there had max contacts of zero, after deleting them all, the project opened! Thank you so much! Have an amazing day.