0 votes

I imported a model and made sure all vertices are aligned vertically to create a perfect flat surface. From this model/mesh I create a static body. The sphere, which is a RigidBody with a sphere as it's CollisionShape rests on this surface. When I call ApplyImpulse from the RigidBody Origin the ball moves but it is bouncing/hopping/jumping over the surface as if it was not flat.

Upon creating a planar mesh with a planar static body the ball did smoothly role over the surface so it probably has to do something with my mesh. Like I said, the surface I'm talking about is completely aligned in height. No smoothing group is being applied on the surface the ball is rolling. This is what the mesh looks like:

enter image description here

in Engine by (12 points)

Are you creating a convex collision shape or a triangulated one? In your image the collision shape is not visible, this shape is what the collision systems uses, you may needto change this shape to have a smooth movement.

@davidoc I used the import hint -col on the mesh node in the model. The hierarchy is mesh>StaticBody>CollisionShape where the CollisionShape holds the mesh again.

Ok, I changed -col to -convcol and the ball interacts properly with the mesh now. But obviously the ball is hovering over the green area since I now have a convex collision shape. The only solution to make a curve like in my image would be to cut up the floor in multiple meshes and create conv pieces out of the floor, perhaps put 3 or 4 quads per mesh. But since the walls need the smoothing groups, I have to deal with the less accurate concave collision for them and I already noticed some strange bounce behavior from the walls in my previous tests.

I have not used import hints, but you could try -colonly with another meshes only intended for collision, and leave your original mesh with the smooth groups. You'll need to experiment what fits your needs better.

I did this and it works a lot better now. Even the walls, being a concave collision mesh do a good job. However, splitting the floor up in parts does pop the ball up when it goes across this edge. I made sure these edges are aligned within the engine and model itself. Is there some setting to reduce this effect on the rigid or static body?

There are issues with the physics system, when you mentioned it I tested my game and there are some pushing when moving over the connection of two rigid bodies. It may be a bug, I suggest you to create a simple project and post it on github.

Please log in or register to answer this question.

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 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 webmaster@godotengine.org with your username.