Procedural Mesh collision issue after updating mesh

Hi !
I started learning UE4 a few weeks ago with some official UE4 tutorials, and now i wanted to try the procedural mesh (to eventualy make an Populous 3 like engine)

So i proceded step by step:

  • first draw a triangle
  • make a quad
  • make a flat terrain of quads
  • apply an heightmap with perlin noise
  • made a material based on the height

And now i try to edit my mesh ingame, so i checked out how to raycast, mouse position etc…
So i can now click on an square of my map, and if i click the clicked square get his Z position incremented by 10

But it only works (lets say i have an map of 10*10) with 30 first squares (or one more if i first click on a random square over the 30 first)
After the 30 first the raycast doesn’t work hit (and the camera is no longer blocked), and i have no idea from where this bug coming from.

The code on my project is in C++ but i have converted it into a blueprint in a new project and made a small zip archive (400 ko) so you can test and see by yourself

There is only one blueprint for the map generation, the player controller and the gamemode are just to activate the mouse

Thanks in advance for your help !

ps : sorry for my english, its bad and i’m very tired

If Vertices count is changed , collision is not updated by “UpdateMeshSection” . You will have to create mesh section again .

Oh thanks it works !
But im very curious to know why the collision is updating that way and not keeping the first calculated collision.

I made some test (different grid size and first raytrace hit at different position) and the result are very “random”

edit : can’t edit to set title as solved.