0 votes

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 :

extends Area2D

var move = Vector2.ZERO
var look_vec = Vector2.ZERO
var player = null
var speed = 1

func _ready():
     look_vec = player.position - global_position

func _physics_process(delta):
     move = Vector2.ZERO
     move = move.move_toward(look_vec,delta)
     move = move.normalized() * speed
     position += move
in Engine by (18 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.