Having an enemy or object that drags the player towards it

Godot Version

4.2.2

Question

Well that kinda sums it up, Ive tried looking for an answer to this but haven’t come across anything, as of right now I essentially have an enemy that has a area2D node for detecting around itself, and what I would want to happen is that if the player enters that radius they would be dragged towards the enemy

The only 2 ways I think that I could have this work is by somehow changing the gravity to center on the enemy temporarily, or By maybe changing the players velocity towards moving towards the Center of the enemy

I don’t fully know how I would do both and only have rough ways that I have tried but didn’t seem to work.

TLDR - I want to take the player and drag them towards the center of an enemy from wherever the players global_position is if in the detection range

I think your aread2d idea is valid - even adjusting the players x/y position towards the enemy could work.

Having multiple enemies move the player around could be hilarious and fun. :laughing: