October 2016
Intermediate to advanced
452 pages
9h 47m
English
If you've noticed, inputs of 1.0 right and 1.0 forward will actually sum to a total of 2.0 units of speed. This means it is possible to move faster diagonally than it is to move in purely forward, backward, left, or right directions. What we really should do is clamp off any input value that results in speed in excess of 1.0 units while maintaining the direction of input indicated. We can do this by storing the previous input values, and overriding the ::Tick() function.
Open a project, and set up a Character derivative class (let's call ours Warrior).
AWarrior::SetupPlayerInputComponent( UInputComponent* Input ) function as follows:void AWarrior::SetupPlayerInputComponent( ...
Read now
Unlock full access