How do I have an Area2D track and follow a KinematicBody2D?

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

Hey all, I’m new to using Godot, and I’d like a little assistance in putting together some things. Namely, a magnetic mine that follows the player when the enter an Area2d (named “DetectionArea”, though it also would be the tracking space.)

How can I apply a thrust to the “Mine” so that it tries to get to the player’s ship?

Is “DetectionArea” subnode of magnetic mine? If it is, then check is Player entered DetectionArea of magnetic mine with corresponding signal body_entered( ) . Then apply force in direction of a vector between mine and Player (“angle_to” function of Vector2 class).

pospathos | 2018-12-01 18:14

I think I got it figured out. Thanks, pospathos.

System_Error | 2018-12-01 21:25

Hi, could you please post your solution and mark it as the best answer? so other people with same question see it’s resolved and can read the solution. Thanks!

p7f | 2018-12-02 01:12