Detect keyboard input for in-editor construction blueprint?

Heya!

I’m working on a mine cart racing game at University and struggling with capturing keyboard input.
I made a node actor that you can drag around and the editor which will scan for splines around it. When it finds the start or end point of a spline nearby, it will add it to an array so that the minecart sees it as an intersection and is allowed to switch splines.

In order to make this easy to use for the designers that will be building levels using this ‘tool’, I want to add a “Snap mode” that, when enabled, will move all the attached spline points while moving the Node they are attached to. However I can’t seem to find out how to detect keyboard input in my construction script to toggle this mode on and off.

Help is much appreciated as I was unable to find anything on the topic of in-editor input detection and using construction blueprints this way, and I’m just getting started with Unreal (used Unity in the past).

Thank you!

Hello Wesleyyy,

The construction script only runs once when the level is compiled, or when any changes are made. As a result, you are unable to detect keyboard input in the construction script. You would have to implement your system in the event graph, and detect your keyboard input there instead. Hope that helps!

Have a great day,

Sean Flint

Thank you for clearing that up. I’ve implemented the desired behavior by adding a public boolean, which is slightly less convenient but does its job. Thank you!

Can you explain what you did?