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"

Base Color defined by variable in Level Blueprint

Hello! So I'm not sure if my approach to this task is using the correct logic, but here's what I'm trying to do:

Upon launch, 1 of 7 predefined colors is chosen, and applied to an assortment of materials in my level.

In my level blueprint, I first have a random integer chosen between 1 and 7. I then go through a series of IF statements, checking which number was randomly chosen. As soon as a branch is triggered as TRUE, a Linear Color Variable, "StartingRoomColor" is set to the corresponding color.

Question 1) If I want to use the variable "StartingRoomColor" as a base color on several materials, do I control this in the materials themselves, or do I have to setup a blueprint on objects that have those materials applied to them, and control it through dynamic material mumbo jumbo?

Question 2) How? I'm happy to follow tutorials or read documentation, but I'm not sure what terminology to search for to do this process.

[More info] My level blueprint may not be the most elegant approach to this, but the reason I set it up this way is so that I can expand upon it later for a puzzle element I plan on implementing. For example, if my StartingColorID variable is 1 (white), I will have logic in the level telling other materials to display as StartincColorID +1 (red).

Thanks for your time =)

alt text

Product Version: Not Selected
more ▼

asked Feb 23 '15 at 05:14 AM in Blueprint Scripting

avatar image

194 34 31 42

avatar image alperenakyuz Feb 23 '15 at 10:36 PM

I'll help you out, Just give me a few minutes to construct the blueprint and post screenshots.

avatar image hypersapien Feb 23 '15 at 10:39 PM

Thanks! I suppose I could have simplified this question and removed the random ID part of it. Essentially I just need to know how to reference that Linear Color Variable from within either a material or a different blueprint.

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

1 answer: sort voted first

First of all, you need to store this information with a persistent acto, the game mode or player character would be appropriate. I chose the Game Mode. Here is how I wired it:

alt text alt text

more ▼

answered Feb 23 '15 at 10:48 PM

avatar image

2k 62 24 111

avatar image hypersapien Feb 23 '15 at 11:18 PM

Thank you for taking the time to set that up, alperenakyuz. I think I should be able to follow that example fine enough, but may I ask you some questions about it?

1) What is the advantage doing the randomization blueprint in the game mode/player character BP?

2) In your second image you have a BP network on the MyCharacter component (is that correct?). Would I create this network on which ever object I wanted this material to be applied on? Or does it automatically alter any instance of the named material in the scene?

Thanks again, I'll give this a try when I get home tonight.

avatar image hypersapien Feb 24 '15 at 05:07 AM

Alright so I've had some time to play around with this, and I see the answer to #2 in my above post. I hadn't noticed that Mesh reference when I glanced at this earlier.

Unfortunately I am unable to get the results I'm looking for because I need my target to be a blueprint and not a mesh. I'm not sure how to handle that.

Example: I have a blueprint, lets call it "RoomBP", which contains other blueprints such as "DoorBP", "WallBP", etc, each of which contains multiple mesh objects. Each of these mesh objects share a material, and I was hoping I could script something at the RoomBP level to basically say "every instance of this material within this blueprint, use this new color".

Throughout the level I would be spawning multiple instances of RoomBP, and I would need each to use a different color.

Is this possible? Is my question beyond the scope of what this answerhub is intended to handle?

avatar image hypersapien Feb 26 '15 at 04:57 AM

Because this question seems to be more complicated than I originally expected, I have redirected it to the forums, here. If I solve the issue I'll mark this post as the answer so anyone who ends up here in search of answers can find it.

avatar image alperenakyuz Mar 15 '15 at 10:26 PM

Hey again, I've been away for quite a while. Have you found an answer or should I attempt one?

avatar image hypersapien Mar 16 '15 at 02:48 AM

I haven't been able to solve this, so I re-strucutred my scene to avoid the question altogether. now instead of blueprints inside of blueprints, I just have a singular blueprint that contains all the mesh.

(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