Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Change specific/one color on a paper2d sprite

I have a paper2d sprite that has brown boots, and when I equip other boots they are supposed to change color, so I figured I would create a material for each color, or create a dynamic material that would do this. After two days of not fully grasping materials, I decided to just create flipbooks for everything, but then I remembered why I wanted to create a material in the first place. I no longer have any of the material blueprints because I deleted them after deciding to switch to flipbooks, but I remember I tried a lot of lerping, and the closest I got to replacing just one color was changing the body to black and the face to white. Not good is it?

Can anyone help me figure out how to replace one specific color on a paper2d sprite/texture in materials? I have seen a few posts on this already, but none of them work on a paper2d sprite.

Product Version: UE 4.13
more ▼

asked Oct 25 '16 at 07:30 PM in Blueprint Scripting

avatar image

7 2 3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

You need a mask (black and white image not grayscale) flipbook texture where only the boots are white, and everything else is black.

Then you can that as the alpha in your lerp node. Then you can connect your original flipbook to the A input, and multiply your flipbook by a color and connect it to the lerp B input.

more ▼

answered Oct 25 '16 at 08:26 PM

avatar image

Night Watcher
1.7k 44 12 71

avatar image JumpinDownaHole Oct 25 '16 at 09:57 PM

This is working perfectly in the editor, but in game I can only manage to either show a black border around the sprite, or nothing changes at all. With my limited knowledge/experience of the material editor, I am seriously struggling with details settings/what to connect the last pins to. If I hadn't spent the last two (soon to be three) days in the material editor, I wouldn't ask this, but would you mind showing me an image of this setup if possible?

avatar image Night Watcher Oct 25 '16 at 10:44 PM

can you post a screenshot of the material, and the result?

avatar image JumpinDownaHole Oct 25 '16 at 11:02 PM

I wish I thought of doing that when I replied earlier... I can't at the moment as I don't currently have access to the editor, but as soon as I get home tomorrow I will post a screenshot.

avatar image JumpinDownaHole Oct 26 '16 at 11:38 AM

I set up a new project just to make sure something else wasn't interfering, and it turns out it kind of is, but I still can't get it to work properly anyway. I couldn't find any flipbook nodes other than the node to create a flipbook, so I used regular texture samples, and I also used a sprite of Simon Belmont as the artist doesn't want their sprites public. The set up I used was the only way I could get the sprite to not be any of the following: invisible, black border, nothing changed.

The problem in the new project is only part of one boot is the new green (test) color, the real project nothing changes at all.



This is as close (I think) I could get it from your instructions as I couldn't find any way of using a flipbook instead of a texture sample. Again this is mostly if not all down to my lack of experience with materials. For some reason I thought I'd be able to get away with never using the material editor, and I can honestly say I was as wrong as you could get.

materialeditor.png (226.0 kB)
playwindow.png (23.1 kB)
avatar image JumpinDownaHole Oct 26 '16 at 11:59 AM

Okay, this actually works perfect on the real project sprites in a new project (something I should have tried in the beginning). I'm guessing because Simon's feet kind of need redoing it doesn't look so good, but on the real sprites it's as perfect as can be. Now I just need to figure out how to apply this to all sprites in a flipbook, and why this doesn't work in the real project. I really appreciate the help, and I will now mark your reply as the answer.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

so have you figured how to apply it to all sprites yet?

more ▼

answered Aug 04 '18 at 09:26 PM

avatar image

26 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question