Hit Input Key From BP


I have done an animation within Level Blueprint includes different nodes including timeline and arrays driven by my InputAction in Level BP script. For now, I added Spacebar to interact this animation. I also want this to be driven from my GUI. When I click specific button, I want my blueprint to hit “Spacebar” for me. I know it doesn’t make sense, but I am experimenting stuff. Is there a way to do this?

If you want to read more what I am trying to do:
I have a day/night cycle in Level BP. When you hit Spacebar, it cycles through day and night. I have also a GUI where you can change some stuff, and I want to be able to change the sun within this GUI as well. I tried creating a function for day/night cycle and it doesn’t accept Timeline in it. Considering my script is full of nodes affecting each other, one way to solve this seems like the casting but I am not experienced enough to cope with so many castings at the same time

Thank you so much for your help!

It is so nonsense that I couldn’t even explain it, sorry.

Shortly: when I click a spesific button from my UI, I want it to hit Spacebar for me (to activate an animation I did for day/night cycle). I am feeling creating a function and casting to it seems to be the better way, any ideas how can I do this?

What exactly is your question?

AFAIK there isn’t a direct way to simulate input events.

Why don’t you simply create a custom event and call this from your spacebar input event and from your animation as well? Maybe this will help you:


That makes much more sense then firing up spacebar, thanks! I will try that now