0 votes

In an effort to create a collsion mesh for a rigid body, I created a Convex collision shape (from the mesh menu that appears when a MeshInstance is clicked). As expected, a shape encompassing the object appeared. However, when the object spawns in game, the game slows down to the point where it breaks. The exact same, if not worse, happens if I try to generate a trimesh collision shape. But when I use simple primitives as collision shapes, everything goes without a hitch. Is there something I am missing with convex shapes?

in Engine by (1,875 points)

1 Answer

0 votes

I had the same issue while using move_and_slide() and it was colliding with trimesh. I fixed it by setting max_slides=1 on move_and_slide().

I don't know why it works for me and how, but I've got no more slowdowns. You could try this, if you are also using move_and_slide() function.


by (203 points)

Thanks for your response.

I think it isn't working though. Here's my code:

move_and_slide(velocity,  Vector3(0,0,0), false, 1, 0.785398, true)

The code is working, but the game still slows down to the point of crashing. Am I doing something wrong with the method's parameters?

This is exactly what I use. Try it out:

move_and_slide(MoveVector, Vector3(0,0,0), true, 1, 0.3, true)

MoveVector is in my case the direction I want to travel + calculated movement down due to gravity. My map have only light slopes, so maybe this 0.3 instead of 0.78 makes a difference.

Nope, the problem persists. It mustn't have anything to do with the slope. The moment the objects spawn in the world the game slows down.

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.