Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Setting gravity through PhysicsServer2d not working #100

Open
dredawkins11 opened this issue Jan 22, 2024 · 0 comments
Open

Setting gravity through PhysicsServer2d not working #100

dredawkins11 opened this issue Jan 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dredawkins11
Copy link

Describe the bug
When setting the gravity at runtime through PhysicsServer2D, nothing happens. With the exact same setup, switching back to GodotPhysics, the gravity is changed as expected. I'm not sure if there is a way to change the gravity through a different part of the API, so if that could be provided, I'd be grateful.

To Reproduce

  1. Create new project
  2. Add a physics body that would be affected by gravity
  3. In a script add: PhysicsServer2D.area_set_param(get_viewport().find_world_2d().space, PhysicsServer2D.AREA_PARAM_GRAVITY, 0) (the code suggested by Godot docs)

Expected behavior
The gravity should change to the value (in my case 0) through use of the normal Godot API

Versions (please complete the following information):

  • OS: Windows 11
  • Godot v4.2
  • Box2d v0.9.9
@dredawkins11 dredawkins11 added the bug Something isn't working label Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant