Binding input in an Actor class

I would like to know if it is possible to bind input events to functions in my C++ Actor class. Similarly to the functionality that is provided in the pawn class with SetupPlayerInputComponent. I’ve looked around everywhere as far as I know for a solution to this and the only thing I’ve found is this: Bind input in custom Actor - C++ - Unreal Engine Forums which ends up not working for me. The test I made with the solution from the thread is the following code:

InputComponent = NewObject<UInputComponent>(this);
InputComponent->bBlockInput = bBlockInput;

if (InputComponent)
{
	InputComponent->BindAction("MouseClick", EInputEvent::IE_Released, this, &ApaddleClass::clickRelease);
	InputComponent->BindAction("MouseClick", EInputEvent::IE_Pressed, this, &ApaddleClass::clickOpen);
	EnableInput(Cast<APlayerController>(GetOwner()));
}

All of that is in my BeginPlay() function. What ends up happening is the ClickOpen() and ClickReleased() functions never get fired.

Just as a side note: I have two of the same actor present within my scene and if I understand it correctly, or at least what I want to happen is the ClickOpen() and ClickReleased() functions to get fired for all of the same actor present withing my scene whenever I click anywhere in my scene.

I know I can use the OnClicked() and OnReleased() delegates from a collision component and bind my functions to those, but I’ve already done that and that works. However, it doesn’t give the effect I want in that if I release the mouse click and the cursor is not over the collision component, the OnReleased() delegate function will not fire. I want that function to fire no matter if my mouse cursor is within the bounds of the collision component or not which is why I’m trying to find out how I can bind input events to functions.

Just to summarize the solution I’m looking for. I’m basically looking for a way to detect mouse clicks and releases no matter where I click or release.

I did some more digging around and found a forum post that kind of shows a similar situation to mine and might work for me. InputComponent and Actors - C++ - Unreal Engine Forums

I can only test it once I get to my work PC and will post back with results once I’ve tested it. One thing’s for sure, I’m starting to question my understanding on how inputs, controllers, and pawns work in the engine.

Following the instructions from the forum post, I got at least the inputs to get bound to my functions. However, since there are multiple of the same actor in my scene, it only works for the last one that is spawned into my scene. I would like to have all the actors of this class to receive input.

Also, whenever my mouse leaves the bounds of the collision component on the actor, it still goes back to it’s original position.

I would look at the bBlockInput variable from the docs. AActor | Unreal Engine Documentation Try setting it to false.