Parent class for generic mesh?

Is it possible to have a generic type for a mesh instead of having to choose a skeletal vs static mesh?

Here is my use case: I want to create a generic plant class which will have various sub-classes. Many of the sub-classes will use a static mesh. Maybe a few (e.b., a venus flytrap) will use skeletal meshes since they will move. Is there a way I can create a mesh variable which I can pass around through functions without deciding on whether it is a skeletal mesh or static mesh until later (i.e., until the sub-class instead of the parent class)?

To say it another way, is there a type I can pass around and then cast to static or skeletal mesh later? I guess I could use Actor but that seems like too much of a hack.

Thanks,
-X

The only thing that you can do is this:

  1. Create a new blueprint based on the Actor class
  2. Create a variable called Mesh with type of Object. Flag as editable and Expose on spawn in the variable properties
  3. In the Contrunction Script add this as follow:

If you need to keep track of the type of your mesh you could create a Enum. Like this:

Then you can set your mesh through the Details panel of your blueprint.

The worst side of this method is that you have each type of assets listed.

Thanks. That’s a good answer.

I suppose if I really want to go this route, I could create a macro to do the above.

Thanks,
-X