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"

Same colored spawn objects between blueprints

Hi. I have 3 blueprints.One them is for Spawning. The other 2 are for generating colored geometrical shapes and letters. First I create random geometrical shape from a shapes list with a random color then I create a letter with a random color. I want geometrical shape and letter have not same color because I can not see letter above geometrical shape. Im attaching my blueprints how can I solve this issue.

Here is my work http://www.dosya.tc/server13/fr7lmf/MusdyDeneme.rar.html

Some Photos My Letter and Geometrical Shapes Blueprints is same. alt text alt text

My Problem

alt text

My Spawn Object blueprint alt text

Product Version: UE 4.18
Tags:
more ▼

asked Jun 07 '18 at 09:27 PM in Blueprint Scripting

avatar image

Tuqayqokce09
11 2 7

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

2 answers: sort voted first

If the color indices are the same for both the letters and shapes (i.e. Color option 1 on shapes is red, color option 1 on letters is also red) you could use a variable to store the color choice of the shape on each instance of the shape BP and when spawning the letter (or vice versa, can't really understand your code language as to which spawns first and what not) have a check between the variables to make sure they aren't the same, if they are have a custom event fire to repeat your "randomization" of the color until an appropriate color is chosen. Basically the logic is as follows:

  1. Spawn shape

  2. Set shape color

  3. Store color index as a variable on instance of Shape BP (i.e. color index 1 was chosen)

  4. On overlap set color of "Letter", store color index chosen as variable on instance of Shape BP (i.e color 2 was chosen)

  5. Compare color indices between shape and letter (shape index is 1 : letter index is 2 --> OK...skip step (6-7) "OR" Shape index is 1 : letter index is 1 --> BAD!)

  6. If BAD use custom event or loop back to repeat code that sets the color of the letter.

  7. Repeat step 5 until "OK"

more ▼

answered Jun 07 '18 at 10:27 PM

avatar image

Nebula Games Inc
5k 27 9 14

avatar image Tuqayqokce09 Jun 08 '18 at 09:05 AM

I sort of managed to do that what i want by following blueprint but still the color which has 0 index (red in my case) still appears on top of the red colored shape. For rest of the colors its ok. I need to make an exception to the 0 index but i am unable to do that. Thanks for answers. my blueprint

adsız.png (51.8 kB)
avatar image Tuqayqokce09 Jun 08 '18 at 09:11 AM

i should make a branch just after the inputs: if the input is 0 create random integer in range [1:9] else (input is between [1:9]) do the above operations. i tried to make it but i could not be able to do it. i am very new to unreal engine. thanks.

avatar image Nebula Games Inc Jun 08 '18 at 01:35 PM

I think you are over complicating the situation. That doesn't make sense. Screen shot your blueprint that works for every number "except 0". Then we will go from there.

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

My lazy way is to take the color of the shape and then assign the letter color as R: 1 - shape color's R, G: 1 - shape color's G, B: 1 - shape color's B, A: 1.

This should work as long as nothing has R: 0.5, G: 0.5, B: 0.5 (gray) or close to it. It just makes the letter have the exact opposite color.

more ▼

answered Jun 08 '18 at 07:03 PM

avatar image

mightyenigma
3.8k 18 20 20

(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