Hello,
I’m working on a physics based game where a ball (RigidBody2D) is falling pulled by gravity and the player has to keep it up by blowing with a fan (the fan’s air is an Area2D).
I have been able to modify the gravity so the ball can go up and down, but now I want to apply a small horizontal force to the ball if it enters the Area2D from a side; I’ve been looking around on ways to detect from where the RigidBody2D enters the Area2D, but I have not found a solution yet.
If anyone can provide any pointers, I would be grateful.
If your fan or a ball will ever be a child of another node that has its position moved, your code will not behave the way you expect it, because its position will depend on the parent’s position.
I would suggest you to use global_position instead, it will work regardless of how your Nodes are parented and moved.