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"

Keep slider position after reactivating the widget

Hello UE4 developers! I'm solving material change system for my work project. The goal is to click on asset and change color via HSV sliders. Everything works fine except one thing. Whenever i click again on the same asset where the color has been changed my material is reseted back to original one and 0,0,0 values on sliders. Any tips how to keep sliders on their postions after setting them? Thanks in advance to everyone for tips :)

PS: Wud love to know at least how to add number values to those sliders.

Widget blueprint: alt text

Asset blueprint: alt text

Material: alt text

So I click on the door the widget shows up i set up a color, close it and everything is fine...alt text

Can run around the color holds till I want to upgrade it ... there comes the problem the slider setup resets to original alt text

Product Version: UE 4.18
Tags:
widget-slider.png (372.1 kB)
door-bp.png (283.2 kB)
material.png (603.6 kB)
matchange.png (1.4 MB)
more ▼

asked Feb 28 '18 at 04:04 PM in Blueprint Scripting

avatar image

Sicra
12 3 3 7

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

1 answer: sort voted first

Hello!

Problem is super "simple" you add a new widget class everytime when you click on the door.. After you add this widget, your blueprint setting parameter on material via the added widget.. That means actually you set default "Color Pick" from newly added widget in tick..

I think you should save Color in BP_Door itself and update them from Widget or you can save a created widget object reference in your BP_Door and check if you have valid widget you should set visibility instead of creating a new widget..

more ▼

answered Mar 01 '18 at 09:47 AM

avatar image

AmphDev
1.5k 15 9 34

avatar image Sicra Mar 01 '18 at 11:07 AM

Maan youre tha best! Thanks ... I hate when I can't solve simple problem, but the eufory after solving it YAAAAAAY true feeling of FFS(fuking finally solved!)! U made my day thanks a lot!!

Solution: alt text

avatar image AmphDev Mar 01 '18 at 11:19 AM

you are welcome.. but this code will not work if you wanna more door :) because you will do for loop on all added material widget and set color with each iteration.. Try this instead of foor loop (sry i dont have ue4 on my fulltime work pc) alt text

widgetref.jpg (950.5 kB)
avatar image Sicra Mar 03 '18 at 05:29 PM

Saved day number 2..:D Thanks !!

(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