How to reflect a bullet?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SebSharper

Hi. I want to reflect a bullet when it collides with an area2d I have. It should reflect, like if it was bouncing towards the exact opposite point.
The image above is an example of how the bullet should behave when it hits the area2d.
This is the code I use when the mouse has been clicked to fire the bullet, if it is any useful:

bullet_instance.apply_impulse(Vector2(), Vector2(bullet_instance.speed + base_speed, 0).rotated(rotation))   //bullet_instance is an instance of a bullet scene, it has alredy been added to the scene tree and set the position to the gun

Also, my bullet instance stores the speed of it with the variable of the same name.
How would this work?

I don’t know, but i use vector.bounce method and pass collision normal

To give me bounce from that point

xCode Soul | 2020-12-08 09:01

:bust_in_silhouette: Reply From: rustemsk8

isnt it Vector math — Godot Engine (stable) documentation in English
there’s bounce option
as for radians, you just need rotation pick one in 180 - 45* < x < 180 + 45* … somehow