I am trying to do Walk / Jog / Sprint and that much is fine however i want to prevent backwards sprinting when the player is running backwards. If the player presses the sprint action key and runs forward but then presses backwards having never let go of sprint then they are sprinting backwards (not what i want!)
To overcome this i thought of adding a while loop that will check if they are moving backward or forward however i get the “Infinate loop detected”
While my code may not be the ideal way this is done its all part of my learning the engine and if you have a better way i would love to hear it, however i would still hope somone can explain to me why this is an infinate loop when i have tested the DOT value and it is indeed changing between 1 and -1
Here are some screenies!
Thanks in advace
The Start Sprint function:
Where / How the function is called:
I also tried it this way so that the loop was not dependant on the DOT and still it detects infinate loop and i have no idea why
Correct me if i am wrong but the only infinate thing about this is if the player keeps his finger down!!