How do I enable collision for custom mesh at runtime?
I've successfully assigned an array of triangles to a custom mesh, and it's displaying just fine. What would be the best way to enable collision for this mesh during runtime? I want the player to be able to walk upon the mesh.
I am using a 3d simplex noise function in C++ that I've exposed as a blueprint node to generate the terrain on the fly, seeding a random float to the Z value for randomization, using the rest of it as a 2d noise function (hope that makes sense). Long story short, I'm generating random terrain via custom mesh triangles, and I want to walk on it.
Here is my unsuccessful attempt to add collision:
And here is the screenshot of the custom mesh triangles in case anybody was interested in seeing what I've got so far (they still don't have collision though):
I'm also trying to find out what other problems I might run into in terms of AI, navmesh, and level streaming using a noise function to generate a world. As far as I know, there aren't a lot of examples of this type of world generation in UE4, and I'm interested in what kind of trouble I might run into later, but I'll save those troubles for other questions, right now I really just want that collision!
If there is a better way to generate terrain like this, I'd love to hear it as well.
asked Oct 03 '14 at 01:24 PM in Blueprint Scripting
As far as I know, this is currently not available by default in the custom engine.
A developer says something may be available in 4.5(Which is currently in preview) here: https://forums.unrealengine.com/showthread.php?2695-Implement-Runtime-Collision-Detection-for-Procedural-Generated-Meshes&p=137073&viewfull=1#post137073
I did a bit of testing with this and it worked but it was extremely slow: (I did not troubleshot why it was so slow and it may be a simple fix) https://wiki.unrealengine.com/Procedural_Mesh_Generation
answered Oct 13 '14 at 12:52 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here