How to start a wave of enemy's with a key when the logic for it starts with "Event begin play" ?

I’m trying to replace the event begin play with a custom event key but then the wave dont start anymore. here is an example how this looks like

and i tried to put this logic to it but it is not working or only the key alone hooked to the start or with a branch both methods dont work. Even if i just create a custom event and replace the event beginn play with it the waves arent starting… only the event beginn play triggers the waves and all works…

Any idea how i can make this somehow starting by pressing a key ?

isValidKey? No! BeginPlay has no key. Connect BeginPlay after the branch.

Like this ?

If i do this the wave just starts and still no need to press a key :frowning:

What if Z goes straight into Switch Has Authority? Does that not work?

No that awso dont work. if i press Z then nothing happens. The wave only start when i hook up “event beginn play”… If i replace the event beginn play with custom event than the wave awso dont trigger to start at all :confused:

There must be some way to make this starting by pressing a key somehow i just dont know how it can work… maybe the key has to come later somewhere in the code or something else. I just try this but awso failed to work the wave just starts right away even if the branch requieres a valid key

Try using breakpoints. Select the Z node and press F9 and a red circle should appear. Then when you press Z in the game, it will freeze and you can see exactly what is happening if you step through each node with F10.

Like this ?

When i press play then Z game is not freezing after that f10 does nothing as well not sure how to troubleshoot this and how it should work

Yes, like that. If the game is not freezing, that Z is not registering, probably because the actor this is in is not set up for player control. You need to make sure that the actor this is in has “Enable Input” checked. There are other things which could affect player input not getting to this Z but try that first.

1 Like

how to set this actor blueprint for player control ?

If i can make that that may solve another issue i have with this blueprint that i cannot bind any variable from it to be displayed on my widget have extra posted that here if you are interested to check it out

Yo i found it and you were right. i searched and found how to set the actor to get input and it now works :smiley: awsome stuff ty! I set it like this and now it triggers when i press Z correctly :sunglasses:
bandicam 2023-06-19 00-27-16-910

You could also set Auto Receive Input in the Class Defaults to Player 0 to save doing Enable Input. Glad it’s sorted though.

1 Like

Yeah pretty cool that this works now. Btw if i set this auto recieve input to player 0 will that awso work if i have multiple player character in the game ?

Depends what you want it do. It would only receive input from the first player.

1 Like

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