Download

Swapping between two meshes

Hello fellow devs,

I am having an issue with conceiving a blueprint that basically swaps between two meshes.
What do you think is the best way to do that ?

It would be great if you can provide a blueprint for illustration.

Thanks in advance for your help !

image

mesh

or

Thank you for your answer ClockworkOcean ! I 'll try this right away. Just for my information, if you have more than two meshes. Do you think that is the best way to swap between diffrente meshes ? If so, I’m thinking of putting them into an array. Maybe a multihgate would work.

Small hint in case:

If with this code you are making some system that for eg changes pickups or something that shows state (As mesh), and you will have multiple actors like that in level:

Create actor (blueprint) that has Boolean variable (created and exposed).

Add TWO meshes, and play with “visibility”
if variable is true set one mesh to visible, another to hidde,
if false other way around.

Loading and unloading meshes means you also load/unload textures and materials.
If you have all loaded (then it has all materials, memory atc allocated) engine knows that its always those 2 meshes, so kind of loads it at begin play.
If you dynamically load it will always allocate memory etc, because it does not know that all meshes in all instances of that actor are same.

1 Like

Yes, you could use an array, and just change to the mesh at a given index.

1 Like

Thank you so much for your answer !

Thnak you so much for your answer

1 Like