What's the difference between PlayerInputComponent and InputComponent?

138232-ue1.png

138233-ue2.png

I know that InputComponent is a member of AActor.The PlayerInputComponent just a parameter of SetupPlayerInputComponent function.I want to know what’s the difference between PlayerInputComponent and InputComponent.

Maybe it is a silly problem, but it really confused me.

Thank you for taking the time to read these.

They’re two different variables, and thus need two different names.

“InputComponent” points to the UInputComponent tied to the local actor.

“PlayerInputComponent” could be any UInputComponent passed to the method.

They could point to two different UInputComponent objects, or they can point to the same UInputComponent object. This way the method can perform setup on its own, active UInputComponent, or any other UInputComponent, without necessarily affecting the local object.

Thanks for your detailed explanation.I get it.