0 votes

Hi,
I have three doors that are AnimationPlayer, and when I run the scene and try to open any door, the FPS fall from 60 to 3. After that, they return to 60. I am worried because this maybe will crash the game in mobiles. This is a 3D scene. I also tried to avoid collisions while animating, but it does not take any effect in the scene. The scene has got more animations but they work fine.
How can I fix this error?
THanks in advanced

Godot version 3.3.2
in Engine by (116 points)

How many frames are in the animation and how large is the door? (perhaps show a screenshot)

The screenshot:Here

It might be because of all the CSG Meshes in your walls and door.

As they intersect they "create" a new mesh. What may be happening is that as you animate the door, every frame, the CSG meshes are recalculating their combined geometry.

Does the door need to be a CSG Mesh? Try replacing it with a basic MeshInstance and see if that changes anything.

It works, thanks.

That's really great! I'll put it in an answer so it can be seen as solved.

1 Answer

+1 vote
Best answer

As per the provided screenshot, the door is part of a collection of geometry in the scene using CSG Meshes:

Scene Tree
Constructive Solid Geometry are meshes which can add or subtract from each other, but this is a calculation that has to be performed by the system, thus their unique feature may also severely degrade performance if modified at runtime.

CSG Mesh
In this case, as the door opens and closes it is intersecting the other CSG wall meshes and will be recalculating their combined geometry result on single frame, which resulted in the massive framerate drop as was confirmed.

This was solved by making the Door a regular MeshInstance.

Door and Walls

The solution to avoid this is to replace any CSG components that you are likely to animate (or which may freely intersect other CSG geometry) with MeshInstances.

While CSGs have their uses, they are unfortunately somewhat deceptively advertised as being the solution for level prototyping, when in almost all cases MeshInstances will do an equivalent job for basic level prototyping.

Anyway — while MxtApps has solved the problem, I hope that it helps anyone else!

by (1,014 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.