Download

How to access child mesh?

I am currently working on a small arcade flying game with a couple of different planes.
Some of these planes have propellers and some don’t.
The models consist of the plane body, wheels and propellers if they have them. Each of these are named properly(propeller is named propeller and if there are more it becomes propeller, propeller2, etc.).
These are all merged before exporting to fbx.
When I import them into Unreal I import them as one model.
Now my question is how do I in c++ access the child meshes?
And is my way a good way or would it be smarter to import them on their own and then combine them?

As far as I know, when you merge it to one mesh, it - surprise - IS one mesh, so there are no subMeshes. Also, how would you rotate the propellors if they are merged with the plane-mesh itself (except you did animations in blender / 3DS etc)? Export them non-merged and specify them manually as childmeshes, then you can access those via GetChildComponent()

Oke but how would this work with a plane that doesn’t have a propeller? I am trying to make it so that it does it all on itself and I don’t have to make a blueprint for each plane.

I would make the propellors a own mesh and specify a boolean if the plane should have propellors and pass it a init-function when spawned. If hasPropellors == true, add Child Mesh

Oke thanks for the help I got it working :slight_smile: