x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Changing the material of a skeletal mesh with UI slider

I'm creating an UI for customizing player characters. What I'm currently trying to do, is getting a slider to change the character's eye color. I have made a float variable that's affected by the the slider, like this: alt text ...and I know there is a "set material" blueprint node, but what I can't figure out is how to assign a certain material instance to the character's eyes depending on the float value. I can't find out how to connect the two, so to speak.

Product Version: UE 4.11
Tags:
skärmklipp.jpg (36.4 kB)
more ▼

asked Sep 27 '16 at 04:27 PM in Blueprint Scripting

avatar image

broder_fisk
1 5 4 5

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

2 answers: sort voted first

alt text alt text Update: I changed my approach, to make it a dynamic material and put the eye textures in an array. The float value from the slider is multiplied by 10 and converted to an integer. So far, so good. But I run into the same problem as with the separate material instances - I can change the texture once when dragging the slider, no problem. But as soon as I want there to be multiple textures on the slider, I need to use the variable from my slider in the character blueprint, in which case the character blueprint gets an error:

"This blueprint (self) is not a ChargenUI_C, therefore Target must have a connection."

I've tried to fix that by casting to Chargen_UI; does not work. I've also tried it by connecting a "get ChargenUI_ref" to the "get EyeColInt" in which case I get "This blueprint (self) is not a ChargenHUD_C, therefore Target must have a connection."

I've also tried moving stuff around between the two blueprints, but similar things happen.

characterbp.jpg (310.3 kB)
ui.jpg (304.6 kB)
more ▼

answered Sep 29 '16 at 04:11 PM

avatar image

broder_fisk
1 5 4 5

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

Update 2: I now have a slider that can be moved in game and I no longer get errors, but the eye color of my character remains unchanged.

The setup:

A character blueprint class called "Human" that is the parent class of ChargenPerson, the character blueprint whose eye color I want to change. Human has a dynamic material and a texture array in their construction script, like this:

alt text

My slider, named Slider_Eyes, is bound to a function that outputs the variable EyeColor. I also have an event dispatcher like this:

alt text

And finally, this is what it looks like in the ChargenPerson blueprint:

alt text alt text

Why won't the texture change in game when I move the slider? I have also noticed that while I can cast to the UI, I can't cast to the slider, and I wonder if that has anything to do with it - or if it's related to the texture array or the material somehow.

human.jpg (71.7 kB)
eyecol.jpg (38.6 kB)
chargenperson1.jpg (94.1 kB)
chargenperson2.jpg (37.3 kB)
more ▼

answered Oct 02 '16 at 02:40 PM

avatar image

broder_fisk
1 5 4 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