The fact you correctly call it Arkanoid instead of brick breaker made my day…
I wouldn’t use engine physics at all for this.
This is basically the simplest of programming algorithms in 2D space.
You need not know trig to generate a bounce. Nor anything else safe from basic geometry…
However - from having coded a couple of those. Introducing randomness to the bounce just aggravates the player.
There’s an expectation that the bounce is “correct” to the idea of newtonian space you get when playing.
As far as how.
Add velocity to the ball.
On hit event you take its direction vector and you invert it.
Now to introduce randomness to that, you break the vector, and alter the correct axis to be within a given range.
Because this 2d you only need to alter 1 axis to get the result you want - my guess is it’s the X axis.
The Y axis is probably constant throughout movement anyway.
You can pipe in a random between 0 and .025 to add to the vector, and test…
If it doesn’t annoy you enough you can bump up the value.
Kudos for doing this in cpp too.
(It’s way easier to make the math happen, but BP is more immediate for it).
I’m forgetting something but it is super simple like invert. Just not directly invert.
You invert X when hitting vertical
And invert Z when hitting horizontal
How you detect that was just as simple though cannot recall.
In ue4 impact normal dot forward vector should get you there anyway.