The sides count of the CylinderCollider shape cannot be changed by scripts.

Hi!

I am creating a script to generate colliders, when I generate my collider using this method, everything goes well except for the sides count:

                    collider.SetCylinder(new CylinderGeometry
                    {
                        Center = float3.zero,
                        Orientation = parameters.orientation,
                        BevelRadius = parameters.bevelRadius,
                        Height = 0.4f,
                        Radius = 0.4f,
                        SideCount = parameters.cylinderSideCount
                    });

The number of sides counts is always 20, default value in the physic shape Authoring script (the setCylinder method never uses sides count, it appears when I read the code). The only way for me to change this value is in the editor manually. Can you confirm that this is not an error on my part, and if not what would be a possible work-around?


Unfortunately, there appears to be a bug in the PhysicsShapeAuthoring.SetCylinder() method, where the line in the red is missing from the version that you are using. I think the only thing you can do is to modify SetCylinder() and add the line in red.
We’ll fix this for the next release

Thank you for the quick response, I’ll wait for the fix.