Native physic engine RigidBody no gravity

Does Upbge or Blender physic engine support “gravity” parameter setup for rigidBody physic objects ?
Like most physic engines without using script work around ?
This is needed to make space ship games using physics.

Gravity is set scene-wide, so it’s in the scene settings :slight_smile:
(Or at least it was when I last used UPBGE)

I need gravity setup per object like other 3D engines can do.

You can do stuff like spherical gravity

so, I guess, you could assign custom gravity to each object if you wanted (disclaimer: i’m NOT A CODER)

This is a trick for planets using apply force.
Unfortunatelly Apply force will make the object wooble and will not work for gameplay objects getting collisions with level and other objects.

Upbge or BGE physic are based on Blender physic, but they would need to use a better open source physic api like Nvidia Physix for example, for more features and because thoses are Api are made for games first.

Upbge physic engine does not support Set Gravity per object (unlike most other engines).

aaaah, ty for the info :slight_smile:

huh? only thing that will get a bit wobbly is with units running over an bone animated object, when that object get’s down in movement.

it does, turn of wold gravity and use a script to apply gravity to objects, like nicholas_A shows you. You can then set gravity per object this way

1 Like

It’s another work around needing a script.
His solution is even worse with raycast, this will cost lot of performance when you have a game scene with lot of physic objects and each needing a script doing a raycast and apply force.

While most engines use Physic engine gravity property instead, so they don’t need script, neither they don’t need to use apply force or raycast.

I clarified the request changing the title and description “Native physic engine RigidBody no gravity”.

I know this topic is marked solved but just wanted put my 2 cents in:

As far as I know, using python is not a workaround, it’s part of everything that makes up the entire game engine. Just because there is no checkbox on an object labeled “USE GRAVITY” doesn’t mean it’s a hack to make it happen. One line on the object:
object.applyForce([0.0, 0.0, 9.8], False)
running every frame isn’t going to hurt performance for one object or even 100 objects.

Curious as to what kind of space this is that has gravity for some objects but not for others?

On another matter, turning off gravity in the physics panel doesn’t disable physics(which it is the Bullet Physics engine and not Blender physics) so I don’t see why that would stop you from making a physics based spaceship game.

3 Likes

Bullet (the physics library) allows to set gravity per object. upbge (the last upbge versions based on blender 2.7 or upbge based on 2.8) has an API to do that:
ob.gravity = [0, 0, 0] #iirc
http://shuvit.org/python_api/bge.types.KX_GameObject.html?highlight=gravity#KX_GameObject.gravity

2 Likes

It’s not exposed on Blender interface, but it should be easy to add to logic nodes.

thats what i keep saying, but people keep asking for more logic bricks.

2 Likes