Download

Possible to use interchangable images on a blueprint with a sprite component?

Possible to use interchangable images on a blueprint with a sprite component?

My goal is to create a single blueprint with a Sprite component, and change the sprite before placing it into my world, without this change affecting already placed blueprints/sprites.

Is this possible? If not, what would you recommend?

it is definitely possible to change a sprite image in a blueprint (i’m doing that right now) but I wouldn’t be sure of the system needed to change it before you place it.

Node for changing sprite is Set Sprite. So you would basically need one of these nodes for every single sprite you want to change it to. It could get really complex in the end.

I have a puzzle game where I’m doing exactly what you are saying, if I understand correctly. I have a generator actor that has a reference to the possible sprites and I have a variable on the target blueprint that I set to expose on spawn that represents, in my case, a set of sprites based on an index for different states… though I could have used a flipbook too I believe. The generator just specifies which sprite index in the spawn actor node and the actor blueprint handles it in its construction script with the set sprite node. The other option, if you just have a single set-and-go approach, is to get the reference immediately after spawn actor and call set sprite on it, but I prefer having the actor manage its own sprites.