Input that should start an event that turns a variable on doesn't work

I need help

so I need to make a team select by pressing a button

The button is T

When I press it, it should start the event “Team T”

Team T turns Team Switch variable on

If Team Switch is true, a flag should be blue, if false, it should be red (default is false “red”)

But when I press T, nothing really happens. Sometimes it changes when save but idk. I then need to make a flip flop so that when I press T, it switches my team from blue to red and vice versa

I made the game mode from this video: Unreal Engine 4 Conquest Game Mode - YouTube

1 Like

The only thing your blueprint does when pressing “T” is set a flag named “Team Select” to true.
You’re not showing any place where that flag might be used.

Try this:

  1. select the node that says “Set Team Select checked”
  2. press F9 to make a breakpoint there
  3. start the game playing in editor
  4. press T

If the execution stops and shows that node that you put the breakpoint on, you know that that action was properly detected.
The problem is then in whatever code you’re supposed to be using that checks that flag.

1 Like

Thanks for the fast reply. I tried that and it showed me the node. I will try to find the problem tomorrow since it is late for me. After that I will post what the problem was for other people. Much appreciated!

Ok I followed the nodes and the problem is that the begin overlap node does not care what the button “T” does. How do I make it so that a event (On Component Begin overlap) only proceeds under a variable (the input button). The point is that if I stand near a flag, it only changes when I press “T”. I tried placing the variable after the overlap and it didn’t work.

In the On Begin Overlap function, you need to branch based on the boolean you set:

If the choice is already made, you will need to re-run whatever that code is, when you change the variable value.