Incorrect behavior when implementing 2D planet attractors using Area2D nodes
Describe the bug In Godot, it's possible to use Area2D nodes, to define custom gravity settings. Example, using Godot Physics:
The large planet is a static body, with a gravity well defined thusly:
The smaller planets are RigidBody2D, and stick to the larger planet. Here are my physics settings:
When using Box2D, the following behaviors are observed:
- Originally, gravity well functions
- After a few seconds, the balls start to roll down even though they shouldn't!!
- Eventually they go flying off the planet with extreme speed
Changing the default physics settings (e.g., setting anti gravity), doesn't appear to fix the problem.
To Reproduce Steps to reproduce the behavior: I will provide a test
Expected behavior A clear and concise description of what you expected to happen.
Project I will add one later! Sorry.
Versions (please complete the following information):
- OS: Windows
- Godot: 4.2
- Box2d: Custom version you sent me. Version.txt says 'v0.9.4', but I don't know if that's correct.
@Ughuuu here is the project: area2dgravity.zip
It's all setup for you to play! Just press f5.
What you should see:
Once you've confirmed it's working, change the physics server to Box2D, and observe the chaos!
It is a bit strange indeed. Will need to investigate it.