I have a simple game where the player controls a tank in a nearly completely two dimensional map. I had the firing to where I could shoot a bullet to my mouse pointer but I wanted to have it bounce off walls I know how to do the actual bounce by changing the direction the bullet is moving but I can't quite figure out which way to deflect the bullet. I thought about having the bullet move in the three (or 7 if I use and 45 degree angled walls) other directions and then check if it is inside the part it hit but that feels like it would cause unessisary lag and be overly complicated. Is there a way to do this based on the wall's surface? I'm not asking for a script as it probably wouldn't fit with my one anyway. I just need some pointers or a link to look into. Any help is much appreciated.
I am assuming your making something like Noob Simulator, it looks 2D but realistically it’s 3D. Simple, just use raycasting and a formula to reflect it.
Here’s a bug head start if you have no idea where to: guide here
This should help you reflect your raycasts.
However if you think you don’t need to do this, you can simply use the raycast as a path/guide for the missile to travel on. At a certain speed of course.