Tuesday, 14 April 2015

Player Run Function

By default there is no run function that comes with the UTGame class. To enable such a function was a little more difficult that anticipated. What was required was for the player to be able to run on a key press and to add more complexity to the issue the footstep sounds also needed to increase at the same rate. The unreal script which controls the player speed and footstep frequency had already been highlighted before and so a way to change these values if a key was pressed needed to be established.

After searching through forums the following kismet sequence was found which is set up to allow the character to run with a fatigue system in place. The kismet sequence was recreated but did not work very well. The footstep frequency was not altered and the player wouldn't run very far before returning to a walking pace.  


After spending a considerable amount of time trying to tweak this existing system without any luck I then simplified it as to remove the fatigue section. All that was used was the 'Modify Property' nodes which were originally modifying the property 'GroundSpeed', this was changed to 'MovementSpeedModifier' which was the original property that was changed to slow the game character down via the unreal script. This was just a stab in the dark but worked better than was imagined, the player speed as well as footstep frequency is now increased when the left shift button is pressed along with the WASD movement keys.


The next step is to try and add a sound for when the player is crouched and moving as by default the footstep sounds turn off when crouched.

No comments:

Post a Comment