• 3D
  • Collision problems with different surfaces (FPS controller)

Hi.

I'm playing around with FPS controllers like in this video tutorial series. The controller pays attention for slopes and even works with stairs (via RayCast elements).

I implemented some test levels with models I got from different asset packs of the same publisher. For every imported 3D model (FBX-Files) I used the "create static trimesh body" menu entry (the menu "Mesh" appears at the top of the editor window if a mesh is selected). It creates a concave polygon shape under a static body node. I save every Model as a seperate scene and use them to assemble the levels.

But I got some issues with different types of floor elements. Some of them don't have a flat surface (like a cube or a plane has). There are some very small deeper or higher parts (for example to represent a tiled floor element). Here are some examples (see green circles):

If I use my FPS controller implementation at flat floor elements, there is no problem with it, but if I use it with some of the non flat surfaced floor elements, it comes to issues like stucking at the deeper or higher parts or sliding "into" a deeper part or sliding along it.

What can I do to prevent this?

Is there a better way to handle collision for such elements and if yes, how to do this on complex ones (like the one with the stairs)?

Maybe it's just a fine tuning problem of the fps controller values. I don't know where to start, adjusting the controller or the collision of the models.

Cheers Z3R0PTR

Manually model collision meshes for those surfaces for best results.

Thanks for your reply. I thougt about that doing it in godot by creating multiple collision shapes (and/or bodies), if this is possible. But this was just a thought.

If I got you right, I should make a second mesh as collision mesh, but with less details. Will this work with the suffixes mentioned in the documentation (Import Hints)? So I have to name the second mesh "CollisionMesh-col" for example and it will be imported as the collision mesh?

I wonder how such a fps controller will work on terrain or other bumpy ground.

Another thing I found was the suggestion to increase the physics frame rate, but this was not helpful. It is a little bit better, but not what I want. I think it just increases the rate of collision checks, so some miscalculations couldn't come up (at earlier tests I popped through the floor often).

And yet another thing is, I found the project setting "Smooth Trimesh Collision" was set to false (default). After changing this it gets much better (no sliding along some edges anymore). There are some issues here and there, but it seems to be usable for.

But anyway, if I found out how to, I will follow your suggestion and try to do it with seperate collision meshes even if it is more work (many, many models to rework).

It should, yes. Though that might be affected by the format used for the export/import.

WRT more work, yes, but remember that you don't have to do any texturing on those objects and that you can make a duplicate of the object you make the respective collision mesh for and just simplify that.

Yes, it works.

I imported the FBX file into my 3D-Software and created a simple mesh fitting the huge area of the model with the stairs (see picture in previous post). It covers the "bumps" and so I have a flat area now. I renamed the mesh node and added "-colonly" to it, so Godot converts the mesh into a static body with the mesh as collision shape (concave polygon shape). Btw, as 3D-Software I'm using Cinema 4D R17 and it's integrated FBX-Exporter with Version 7.3 (2013) selected.

But! =)

After switching the project setting "Smooth Trimesh Collision" on (as mentioned in the last post) and with some adjustments to the player collision model and behaviour, the most of the problems has been solved even without reworking the models. The most of the floor/ground models aren't a problem anymore.

Now I can rework the really problematic models only which aren't so many. I'll build some scenes to test them. Maybe I have to play around a little for better fittings of the meshes, but this was a very useful hint.

Thanks again.