How would YOU solve this?

Style is Top down with RTS movement

You have a red cube and a blue cube. There is a red button and a blue button. If the corresponding cube moves upon the corresponding button. The gate opens.

Currently, I have my project setup with:

  • Camera Pawn
  • Parent Cube
    • Red Child Cube
    • Blue Child Cube
  • Parent Button
    • Red Child Button
    • Blue Child Button

I’ve been beating my head against a wall trying to figure out how to make the logic flow. I’m trying to make it where when both cubes are on the buttons the game moves to the next level (In this case for testing, prints a string or something). My main issue is keeping up with the color coordination and the state of the button.

I originally had just the parent actors with exposed material variables that allowed me to set the color while placing them in the level. It worked but I could never get it to fully do what I wanted. I added the child actors to help organize the flow some but I’m just spinning in circles now. Help! Not looking for an exact guide but a push in the right direction… or a guide… either or :slight_smile:

You could:

1 - Use GameplayTag to set your colors: Color.Blue, Color.Red
2 - In your Cubes you set their Tag, in Buttons you set the required Tag
3 - When one Cube overlaps a Button you check if its Tag matches
4 - If true you could add 1 to your GameMode variable, if the overlap ends you subtract 1.
5 - If the GameMode variable is 2 you open the gate.

2 Likes

Finally got around to looking into Gameplay tags and I was able to solve my issue. Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.