I’m struggling with a problem from an architectural standpoint. I’m working a classic gameplay element, the ball and paddle.
In MyPlayerController.h/.cpp I map my inputs to functions, all good. The paddle itself is the default pawn, so the controller can simply get the attached pawn and call the pawn’s move function. I’ve got the basics down, I’m struggling with a clean way to map the launch ball button to the ball.
Previously I did this the level blueprint with a delegate. It was messy so now I want to do things a bit nicer and cleaner. Now I can declare the delegate in the player controller, but I need instances to bind right? That leaves me in the same bind as using a level blueprint.
How should this be approached from a design standpoint using C++? One would think there’s a way set this up more abstractly than binding specific instances in a level. I should be able to, in one place, tell the game that whenever the player presses the specified button, to launch the ball pawn.