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.
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.