Calling DiscardPlayerInput() does not appear to actually discard the player input. The comment for the function indicates that input will be consumed and discarded without doing anything with it. However, when playing the game all input still appears to be applied normally.

Steps to Reproduce
  1. Create a new code project using the First Person template.
  2. Add a new code class to the project that derives from Player Controller.
  3. In the new Player Controller class, override the PlayerTick function (void PlayerTick(float DeltaTime) override;).
  4. In the overridden PlayerTick function, include a Super call and then call the DiscardPlayerInput function from PlayerInput before the Super call (PlayerInput->DiscardPlayerInput();).
    • Make sure to include GameFramework/PlayerInput.h
  5. In the constructor for the project's GameMode class, set the PlayerControllerClass to the new Player Controller class that was added in step 2 (eg. PlayerControllerClass = AMyPlayerController::StaticClass();).
    • Make sure to include the new Player Controller class' header file.
  6. Build the project in Visual Studio.
  7. Open the project in the Editor.
  8. Start PIE.
  9. Provide several movement inputs such as looking around, moving, jumping, firing the gun.

All of the inputs are applied normally even though player inputs should be discarded.

All of the inputs are discarded and not applied.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-60809 in the post.

Login to Vote

ComponentUE - Gameplay
Affects Versions4.
Target Fix4.21
Fix Commit4231543
Main Commit4289353
Release Commit4399518
CreatedJun 19, 2018
ResolvedJul 25, 2018
UpdatedOct 2, 2018
View Jira Issue