jaipack17 / Nature2D

A 2D physics engine for Roblox. Create versatile physics simulations and mechanics with GUIs!
https://jaipack17.github.io/Nature2D/
MIT License
147 stars 8 forks source link

Applying upwards force, makes the rigidbody go downwards #25

Closed jammees closed 2 years ago

jammees commented 2 years ago

Description

When applying an upwards force to a rigidbody, instead going up, it goes down.

Reproduction Steps

  1. Create a rigidbody
  2. Use :ApplyForce() with a random amount of Y force, preferably 50
  3. Put the :ApplyForce() into UserInputService.InputBegan function or any function that get's called multiple times.
  4. That's all

Expected Behavior

When applying upwards force the rigidbody should go upwards

Actual Behavior

The rigidbody goes downwards, instead of going up

Media

https://user-images.githubusercontent.com/86011536/149668837-e2c0dde1-7d22-4f6a-8985-71fce86237e5.mp4

Encounters

Always happening no matter what

jaipack17 commented 2 years ago

This probably isn't a bug, to apply an upwards force, 'Y' must be a negative number. Vector2.new(0, -25) is an upwards force while Vector2.new(0, 25) is a downwards force. Similarly for the west direction is negative X and the east direction is positive X.

Does this solve your problem? If not, am I missing something here?

jammees commented 2 years ago

That's why it never worked for me. It's a bit misleading that it's reversed. Because I always thought that to apply an upwards force the number has to be positive.

Thank you for your help!