Hello all!
I am trying to make a bullet reflect off a collider in 2D game, but i just can't get my head around it. I checked out the breakout sample game, but that's not quite it since it has a fixed reflection angle based on impacting left or right collider of the paddle and the brick, as far as i have seen. There are some pinball playmaker games, but i think there's also no reflection there, just adding force to the ball when hitting the flipper. I googled a lot, and even found some scripts, but nothing does the job unfortunately. I think it can be done fairly simple in Playmaker, but i need some help.
The bullet has a fixed velocity (not force), so upon colliding it only needs to change direction whle keeping the velocity. I am aware i need to use vector3 reflect under the operator advanced action and i've read about the normal of the impact and calculation of the exit angle and thus the rotation that needs to be applied to the bullet but don't quite know how to implement it.
Any help or example is welcome!