Im making a platformer game, and i already have an enemy using kinematicbody2d with his projectile using area2d node.
So, i wanted to make the player to be able to rotate and change the direction of the projectile from the enemy (reflecting) straight back at him by attacking the projectile. I really want to know how i can do this.
Heres my projectile code :
var move = Vector2.ZERO
var look_vec = Vector2.ZERO
var player = null
var speed = 1
look_vec = player.position - global_position
move = Vector2.ZERO
move = move.move_toward(look_vec,delta)
move = move.normalized() * speed
position += move