I have a problem with a custom event running two times in a row for some strange reason. I haven’t posted images of the graph since I’m not sure how that will help. Hopefully I can explain the situation and someone can point me in the right direction to figure out what’s up.
Basically, I have taken the BlackJack sample project and am doing a card/board game based on this setup. Everything works quite well so far, but one of my custom events is duplicating its action for no apparent reason. I have set up the game to allow cards to be clicked making them active. Based on what card is active, a board can be manipulated to place a game piece. After the piece is placed, the card is replaced (destroy and spawn a new one in its place). However, what happens in certain instances is that the replace event runs two times in a row. It’s only called one time and watching the flow in debug mode shows that it is getting to the end of the custom event and immediately firing again, but I have no idea why. I’ve walked through the flow step by step with and without break points and can’t see anywhere that this might be set to fire twice. Also, it’s a single player game and I’ve ensured that when playing in PIE that I’m not running a dedicated server so replication shouldn’t be an issue.
Outside of setting a break point and watching what happens, how can I begin to see what’s going on here? The break point only shows the active node, not what is going on behind the scenes. My project is only using BP, so unless there’s Epic code doing something strange, it’s not a C++ issue.
So, does anyone know off the top of their head why this might happen? If not, what other tools do I have that could help find what’s causing it? I’m completely at a loss.
If more info is needed, I’ll post screens of my event graph. Just not sure what that will help.
Hello,
those are only ideas based on your words :
Check if you have your action called twice (meaning maybe on your click you do it once where you want and once somewhere else.) or if you have for example the same key used for an input action and an event.
If you create event on click, try on release to check if same event occurs.
If you don’t have the ‘Blueprint Debugger’ panel on already, open that from the Window menu and expand the “Execution Trace” to see if there’s something obvious. Like Fen said try using ‘Find References’ on your event from the ‘my blueprint’ panel (it could be invoked from some other BP also of course).
It might be useful to see an image of how you’ve setup the “Click” event for placing the board piece as well (I’m assuming this in turn calls your custom event)
Thanks for the replies. I tried looking at the Blueprint Debugger, but can’t tell what is going on there at all. I’ll have to look for more info on that at some point. Like Fen said, I tried a DoOnce node and added resets where needed and that seems to have fixed the issue for the moment. Still not sure why it happened in the first place. I had checked where all it might have been called and it was only in that one place and there was no good reason. I also changed to click releases rather than clicks just to be safe, but I think the DoOnce nodes will be good enough.
For later debugging : check your loops if by mistake you link loop body and completed on same exit for example (it could be a one on loop and one on completed.)
Same issue here, and Google lead me to this page: Just made my very first clean Custom Event from the Matinee-replacer… and all very simple, just print out a Hello… and it prints twice! Break debug leads to it twice, it’s a double canon!