Geometry Script Displacement issue C++?

Am new to c++ coding, trying to subdivide a dynamic mesh and also displace via a displacement map. The code throws a bunch of errors. Here’s thecode:

And the errors?

Note the sections underlined in red. That’s a decent indicator that there’s an issue there. At the very top, you have 2 includes that it can’t seem to find. Is that the right location for those includes? That’s likely the reason the FGeometryScriptPNTessellateOptions is underlined as well as it’s likely defined in those includes.

EDIT: Out of curiosity, have you tried prototyping in blueprint before moving it to C++? Geometry Scripting Users Guide in Unreal Engine. | Unreal Engine 5.5 Documentation | Epic Developer Community

Yes, done that in blueprints already. Was only testing if it would make the performance better doing the same via c++. Got it working now. Here’s the code:

void UDisplaceMesh::Displace(UDynamicMesh* DynamicMesh, UTexture2D* DisplacementMap, float TessellationScale, float DisplacementMagnitude)

{
    if (!DynamicMesh || !DisplacementMap)
    {
        UE_LOG(LogTemp, Warning, TEXT("Invalid mesh or texture input."));
        return;
    }

    // Tessellate the mesh
    FGeometryScriptPNTessellateOptions Options;
    UGeometryScriptLibrary_MeshSubdivideFunctions::ApplyPNTessellation(DynamicMesh, Options, TessellationScale);

    // Apply displacement from texture
    FGeometryScriptMeshSelection Selection;
    FGeometryScriptDisplaceFromTextureOptions Options1;  
    Options1.Magnitude = DisplacementMagnitude;
    UGeometryScriptLibrary_MeshDeformFunctions::ApplyDisplaceFromTextureMap(DynamicMesh, DisplacementMap, Selection, Options1, 0);

    // Recompute Normals
    FGeometryScriptCalculateNormalsOptions CalculateOptions;
    UGeometryScriptLibrary_MeshNormalsFunctions::RecomputeNormals(DynamicMesh, CalculateOptions);
}