Please, add this option to the Physics Behavior.

0 favourites
  • 6 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • In the Physics Behavior, where is the option to enable/disable or modify the gravity force for a single instance of any object?

    I see that option in the Bullet Behavior, but I don't see it in the Physics Behavior. Please add this option because it can be very useful. In fact, I frequently use that option in other game engines.

  • Gravity is just a force, so can't you just set gravity to 0, and then apply a per-instance custom force instead of gravity?

  • The easiest and most reliable option would be to allow users to set the bodyDef:gravityScale value, the bindings for which should be readily available in the wasm Box2D distro that C3 uses.

    Applying a force per tick would just try to undo what the B2World would have just calculated for an object's velocity change; it would do it imprecisely, and with odd looking results. You certainly couldn't mimic zero gravity using that method.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Another way is to set the gravity to zero and manually apply acceleration to the objects. VelocityY = velocityY + gravity*dt

    You can use forces instead where force=mass*gravity but the values for many things in the physics behavior are off by factors of 50 so you may need to scale values accordingly.

    You could also in concept undo any motion do to gravity by manually applying a reverse acceleration.

    Vy = vy-gravity*dt/2

    Y = y - vy*dt

    Vy = vy-gravity*dt/2

    However that would only work if the object didn’t have any collisions and you may lose a little precision from the calculations.

    You also possibly could apply a force to counteract gravity but the values need to be spot on.

    Anyways that’s just some alternate ideas if you need a more immediate solution.

  • Hello again. I am not really looking for a workaround, I would just like Costruct, like other game engines, to include the option to disable or modify gravity for any instance of any object, as it is a very useful option.

  • I appreciate your attempts to help me through workarounds. But, honestly, I was thinking about purchasing Construct to create games easily, quickly and efficiently, instead of using alternative solutions that require the use of mathematical formulas that have drawbacks and limitations in their results.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)