Download

Moving another actor on keyboard input

Hi all,
i’m just starting to use and learn UE4 for game development. I have a lot of question of course but at the moment i’m stuck with some essential one.
Just to mention that i come from Unity background so if i think in Unity way, please correct me :slight_smile: .

Any way, my problem is with getting input from keyboard and moving another actor (not the possessed pawn which is my main player). I have a simple cube as main player that is possessed and can get input from keyboard and act upon it. I have simple sphere as the ball in the game that can bounce around and collide with the player and the walls. I implemented when the ball hits the player, the ball will stop simulating physics and the her world position will be the same as the cube position, i.e. the cube will “carry” the ball around. Now i want to stop “carrying” the ball when i press the spacebar on my keyboard. My cube (player) class is ACollidingPawn class (.h and .cpp) and my ball class is ABall (.h and .cpp). In ACollidingPawn class i can react to player inputs and do whatever i want on the cube actor (in ACollidingPawn class). But i want to do something with the ball actor when i press the spacebar on my keyboard, i.e. need a way to do some logic in ABall class…

In essence, i want to “do something on the ball object” after the keyboard was pressed without possessing the ball object. ( as i understood, you can only process input on possessed actor)

I hope you understand my problem :slight_smile:

Thanks in advance!