So first of all let me tell you that my C++ skills are relatively basic (no pun intended). So it could be that I didn’t understood some things that could be related to C++. But I also know that UE does handle things quiet differently regarding C++ so… I hope someone here can help me!
Now to what I am trying. I would like to know IF and HOW (if possible) I can convert “FKShapeElem” to “FKSphylElem”?
What I want is to filter out informations out of “FKSphylElem” by iterating through the elements and filter an element by a specific “name”. Here is the StaticMesh-View in Editor where the informations are set:
The problem is, that the “FKSphylElem” does not have the “Name”-Value, but as i understand right through the documentation “FKShapeElem” does. Futhermore, as i understood right, according to the UE-Documentation, the “FKShapeElem” is a parent class of “FKShapeElem”:
So it should be possible to iterate through the list of “FKShapeElem” in “UStaticMesh->FKAggregateGeom”, finde the specific “FKShapeElem” with the desired “name” and finally convert the “FKShapeElem” to a “FKSphylElem” and finally filter out the needed informations!
But when I try to convert/cast “FKShapeElem” to “FKShapeElem” and compile my code, the compiler throws errors. Here is my current try on filtering the informations out:
The compiler tells me that the cast/convert was not successfull:
error C2440: “Initialising”: “To *” cannot be convertet to “FKSphylElem”
with
[
To=FKSphylElem
]
Also trying to set the variables as pointers didn’t work, but that are the part of C++ that I am very weak right now.
So what am I missing here? What am i doing wrong? Is what I want even possible? And why the f* is the name not put into “FKSphylElem” instead of “FKShapeElem”?!?!?!