Hi, i’m brand new to Unreal and I could be going about this entire node wrong, however it works for the most part. My issue is this Get Input Key Time Down function which I have come to the conclusion that the problem is the Get Player Controller as it doesn’t seem to be receiving input at all.
How do I set up the player controller? I’ve tried to look for various sources but nothing seems to help call on a player controller allowing me to simply track the press time of this key. If I missed one I would love to see it.
Basically what i’m trying to do here is make a “vehicle” break and stop, which then on release of the break key will give the player a boost based on how long the break was held, but after the wait (or delay in unreal) it goes back to normal speed (the wait is based off how long the key is pressed also). I know I do have to put a clamp on the float so it doesn’t go too high but without it working I haven’t bothered yet.
This node does the job for breaking and resuming speed with turning working consistently the only issue is working out the boost with the Get Input Key Time Down.
If anyone was kind enough to help me out I would be very appreciative!
Few things to check:
Does the actor have input enabled?
Is there another actor with the S key input set to consume (Click on the node, its in the details panel)
I believe I have those right, am I suppose to make like a player controller outside of these blueprints? Still nothing seems to happen with the player controller and time down.
One thing that sometimes works for me in similar situations is making an Input Action. Set it to the key you want to use, then replace the Keypress Event you have in the graph, with the Input Action version.
Hey! Thanks for the tips, will help for later regardless, however it doesn’t seem to have helped my problem.
I have changed it to input and everything works the same (it breaks and whatnot as intended), however the player controller / get input key time down still doesn’t do anything. (I have also done a few changes unrelated to at least do some development while trying to figure this out.)
I feel like i’m missing something obvious to get the player controller to recognize? Is there really no other steps to setting one up? I’ve tried a few things i’ve read online but no luck.
Just realised, you only try to get the key down time after you release the key. So you will always get zero. Instead you could set a variable to be the time in seconds on press then calculate the difference on release.
1 Like
OMG Your a genius! Just built it and looks like it works exactly as I needed! I question why the “get time down” function isn’t more intuitive. This way is better to begin with as I can adjust things and I even know things are directly in seconds.
Thank you so much. If I had a game company i’d hire you.