Enum issue (nesting, combined, or scrap it?)

I am using UE5.2.1, blueprints. I want to create an actor that dynamically changes its material and type. The material part is easy, but I am scratching my head on the type. The way I did it in Godot (another game engine), is to have 2 enums, one driving the other. I got to the point, where even that was a mess to code for, so I combined them all into one to make it easier.

The issue is this:

  1. I have a list of different base types. Each of those types branch out into their own.
  2. If I combine them all into 1 enum, it becomes a pain if I want to expand on it; but it makes the initial handling of them much easier.
  3. If I can’t have 1 enum drive another enum type, then what is the solution? Create separate objects with their own unique tag?

I am trying to keep things simple and not have to load a specific sub actor; but have 1 actor I can dynamically change and have code react to it based on its type.

Edit: I created a struct with variables pointing to each of the Enumerations. Is this the solution, or is there a better way?

Can you talk in general terms about what you’re trying to do? Not how you would implement it.

So 1. the object can change it’s material.

But 2. it can change it’s ‘type’?

You mean from a basket ball to a gun or?..

Can you give an example?

I thought you should tell us the result you want ,not what are you try to do.

1 Like

I am not changing the mesh, just the parameter. The parameter drives what color and and texture the mesh receives. I got it working using a struct blueprint. But it’s very messy with how it all branches out. I only did the first branch. I need to figure out a cleaner way to do this.

You can make a struct, which is a double enum, and then make a map of that

So, you supply a ‘double enum’ and it will give back an integer. That integer can be the index in an array or colors, material, etc…

1 Like

Maybe you shouldn’t use multiple enums to code this part.
Try use dataasset?Its a struct but you can save pre-setting values as a bp file.for this,you can save your material,or may be sound effect and else in that,and just past it between functions.