Download

simple ( i think question)

Hi guys i have a basic power up system in which my player can run faster and jump higher whilst he has >0 energy_power. It works just fine apart from the fact that if im running with my finger on ctrl the players continues to run untill i loose the key and hit it again … i know this is a simple problem and i think its to do with the fact that im not constantly checking to see if the variable is below 0 only when i press the key but i dont know how to fix that. My good friend gave me a tutorial to follow but its a bit in depth for what i need as i feel my problem is a simple one

SAVED2.png

suggestion:

1)- set your max walk speed to [600] or whatever you want the characters normal speed to be. (can’t remember exact number of normal walk speed)
---- when branch condition is false
---- & from your released output of the ‘LeftCtrl’ key input node
---- (may sound redundant but will be ensure the value is reset)

2)- setup a tick or preferably a timer to check the value somewhere if needed & reset however you need to, etc. (not sure if you even need this but could be necessary if critical)

  • as always testing is the best way to work these things out - try something - save - test *

  • if the character keeps running after releasing this key - the issue is probably somewhere else - what you showed should just set the speed not cause the char to keep moving

thank you but sorry to be a pain could you possibly give me a brief picture and explanation of a timer

no sorry the character does not keep moving if i release the buttons but if i release ctrl the character still moves at the higher speed until i take my finger off and re press it hence the reason i need a timer or tick

timers might take a little work to get the hang of, until then the event ‘tick’ will work
https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseTimers/Blueprints/

sorry if I didn’t make it clear up above but-

your ‘Left Ctrl’ event has 2 outputs the ‘Pressed’ & the ‘Released’
pull from the ‘Released’ output & set your ‘Max Walk Speed’ back to the normal speed (should be in details panel when you click character movement in your character BP)