How to get the game to recognize which material is assigned

so I am trying to get it to recognize when the block is red not any of the other 3 colors um using the print string as a test because the “win state” would be triggered when all 6 blocks are RED. Someone please point me in the right direction. (UE4-26)

Are all the blocks going to be in one BP, or are you going to use 6 of these?

I’d recommend 6 of these, but then you need an extra actor BP to count how many are red.

You only need an IsRed bool. It’s either red, or it’s not.

Yes they are all one BP i just duplicated the actor. Will that still randomize the colors if it isnt red? (im new to this)

Yes it will.

I’ll pop a bit of code in soon…

Ok, notice red is in the zero slot

And I have a watcher blueprint ( you also put this in the level )

( the watcher )

redcube

2 Likes

Thank you. You helped me sooo much.

1 Like

No worries, tell me how it goes.

Notice if you know where the red is ( 0 ), it’s a lot easier. None of this comparing materials stuff… :wink:

Everything worked great I was having an issued at first, but it was because I didn’t set “winner” to true. Thanks again.

1 Like

I’ll pop a bit of code in soon….

.

Thank you.

A single boolean variable, “IsRed,” is all that’s necessary. The situation is clear-cut: the object is either red or it isn’t.

.

You helped me sooo much..
.