Hello all, i am quite new to Godot, never really spent time in game development beforehand. Currently im building a City Building game, first i did most of it in GDScript, though now i moved most of it to C# - Mostly because i like to split the editor with the code and the godot editor up xD and i wanted to learn c# as well.
This is in no way a professional project, just a fun learning project.
And i have some issues that i would like to get some oppinions on, since im kinda lost on what's going on.
So i have this generated terrain, which works and works with the shader and all so it gets the textures applied to it depending on its height, That part works fine without issues.
My issue starts when i want to produce a Collision shape for the terrain, more precise it's telling me that "ConcavePolygonShape3D.SetFaces( faces )" does not exist on ConcavePolygonShape3D.
I then tried to use Faces, since i saw that some object's simply did not have their GET/SET in c# for some reason, but setting it directly worked.
But to no prevail, it also says that the property does not exist.
So now im lost, mostly because im quite certain it would work without any issues if made in GDScript.
In C# i found issues when creating a dynamic trimesh colission as well, it does create the collission but if you try to get the child in C# afterwards to set it's collission layer or to set other options on the static mesh or collission shape then you aren't able to do it since it also there tells you that the method is not found.
Are there anyone out there that can explain to me what these issues are about?. If im doing something dumb or missing something here, so far i've been able to figure out my issues by using google and looking around in source code and more. But this just seems weird because the method im calling should be there xD
The c# that fails is this:
Mesh terrainMesh = this.TerrainMeshInstance.Mesh;
// Get the array of vertices from the mesh
var vertices = terrainMesh.SurfaceGetArrays(0)[(int)Mesh.ArrayType.Vertex];
// Create a ConcavePolygonShape3D from the vertices
var concaveShape = new ConcavePolygonShape3D();
concaveShape.SetFaces( vertices );
But vertices are getting its values as it should, or atleast it seems like that it's getting the data it needs.
And it also does not post any issues in that regard, it merely tells me "SetFaces" does not exist on concaveShape
I need the collission shape so i can fire off raycasts on my scatter generator i've made in C#, to make sure that the trees as an example is always on the ground of the terrain, And also so other rules can be applied. Like if i did not want trees to be anywhere else but on the floor etc. (height:0)
Hope you guys have some input on my prob. idiotic easy issue xD but im new, so ye.. Rome wasn't build in 1 day 😃
Best Regards
Mike