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:
I have a list of different base types. Each of those types branch out into their own.
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.
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?
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.
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.