Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collider doesn't get created by the CreateMesh Module
#1
Hi,

I created a simple straight track with Curvy Generator to test things out. I was expecting a Convex MeshCollider to be created since that's how I configured the CreateMesh Module. I didn't want the track to be updated at runtime, so I enabled "Make Static". Since the collider didn't get created in Edit mode, I disabled "Make Static" hoping it might be created in Play mode, but it doesn't get created at all.

I didn't find any solution in the documentation and don't have any experience with Curvy Splines to fix this.

I'd really appreciate your help.

   


Attached Files Thumbnail(s)
   
Reply
#2
Hi
Does the Unity console show any error message? If not, please send me a reproduction case so I can debug it.
Have a nice day.
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
(12-19-2023, 12:03 PM)_Aka_ Wrote: Hi
Does the Unity console show any error message? If not, please send me a reproduction case so I can debug it.
Have a nice day.

Hi,

Thanks for the reply.

No, there are no error messages in the console.

However, I managed to solve this by myself.

The problem was that in the Create Mesh module, I had disabled the "Auto Update", since in the documentation says that "If enabled, MeshColliders will automatically update if the mesh changes". I want to create meshes (for racetracks) in the editor only, so the meshes would never be changed at runtime, and therefore no need for auto-updating MeshColliders. Nevertheless, MeshColliders don't get created at all if Auto-Update is disabled. I enabled it and the MeshCollider was created.  But I would really prefer to have the MeshCollider created even with Auto-Update disabled since it doesn't serve any purpose to keep checking if the mesh changes in the use case that the mesh would never change.

However, I ran into a much bigger problem:

The MeshCollider that gets created does not correspond to the generated mesh!

The generated mesh seems to get rendered correctly, but on a closer look even though the top and right views look OK, the left view isn't visible. I increased the Input Spline's Cache Density to 100 and Max Points per Unit to 100+ and the Resolution of the Shape Extrusion module to 100 (just in case it were the source of the problem) but no change.

I played around with all the settings and finally, the problem was fixed, but the fix seemed very weird and counter-intuitive:

I set the scale X of the Shape Extrusion module to 1.18 (initially 1) and the MeshCollider finally got the shape of the generated mesh (strictly speaking it still doesn't correspond to the mesh, since it has the shape of a box).

However, the mesh's left side still doesn't render correctly.

I have attached some images for clarity.

I'd really appreciate your help to make this work correctly.


Attached Files Thumbnail(s)
                       
Reply
#4
Hi

1- About the mesh with missing faces: please send me a reproduction scene and I will take a look at it

2- About the autoupdate: you raised a pertinent question, which is should the initial update be impacted by autoupdate or not. I see validity in both ways of doing. I will take a deeper look at this question later, and see if the current behaviour should be changed. Regardless, you can set the auto update to false, and export in edit mode the meshes to be used in playmode. You can find the export buttons in the Export tab of the Create Mesh module:
https://curvyeditor.com/documentation/generator/modules/createmesh#export
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#5
I just emailed you a download link for the reproduction scene through the forum.

Please note that the exported mesh has inverted normals, i.e. when I set it in the MeshFilter of a GameObject I have to rotate the GameObject 180deg on z to become visible.

EDIT: Inverted normals in the exported mesh is not a problem anymore. It was originally a problem when I was experimenting with various settings.
Reply
#6
Issue was discussed outside the forum. For future reference, the issue was due to two separate configuration errors:
  1. In Create Mesh module: Marking the collider mesh as convex while it is not.
  2. In Input Spline Shape: Setting the first and last CPs of a closed spline as Start and End CPs. This removes the "loopiness" of the closed spline.
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Box Collider Alignment Petusarian 5 6 10-21-2024, 10:28 AM
Last Post: _Aka_
  Connections doesn't work in split scenes nehvaleem 4 10 05-29-2024, 07:31 AM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  CurvyGenerator not refreshing until next frame when created. Lupos 2 7 06-08-2023, 12:12 PM
Last Post: _Aka_

Forum Jump: