Physics Gravity Direction

0 favourites
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • Hi, I am wondering if there's a way we can change the direction of gravity with objects using the physics behaviour.

    I know you can add forces to objects, but forces affect each object differently depending on their mass. A large (heavy) object will fall at the same speed as a smaller (lighter) object with gravity... but with forces, the large object is slow, but the small objects are fast. Is there a way to make it constant, without changing each object's mass?

    Hope you guys can help!

  • System.Everytick apply impulse?

  • You have to set the "World Gravity" to Zero and the do an "Apply force towards" in each Tick. Works quite good....

    BTW: you can use "negative force" to pull objects towards something

  • I'll try impulse instead of force, but force doesn't work as expected.

    I'll let you know :)

  • What is the effect you expect from force that you do not get? Gravity as it is, is a force, not an impulse...

  • :( No, impulse doesn't work either... Small objects move faster than the large. Will I have to set the mass to the same?

    **EDIT** Can't figure out how to change the mass... :(

  • If you look at gravity, it does not really matter if an object is huge or small. Gravity applies a force of 9,81 m/sec ....mass makes the difference. It may be, that the pyhsics engine is not good with mass, so you could tune this with different forces...

    Force is an "equal" pull - impulse is a "hit"

  • Hi Weishaupt!

    I did originally have the object set up as force... but it didn't work too well. The smaller the object, the faster the force moved it. I wouldn't have thought it would effect this. I have gravity set to zero, but no luck...

  • I have to see the CAPX to help you further

  • Ok, first impression - this behaviour is as expected! Reason: Object accelerate different due to their mass and friction.

    Lets try to solve your problem the other way around. What behaviour do you want? Maybe there is an easy way to archive what you're expecting!

    BTW: As I understood from some posting of Ashley - the actual mass of an object is detemined by the set mass and the size of the object...I think he even posted the formula...

  • Yeah, mass is density x collision area. If you turn off gravity and watch the movement, all items move at the same speed, no matter the size. I can make them the same speed by changing the density of the item, but I can't figure out the formula to set all the items with the same mass.

    **EDIT** Sorry, turn on the gravity.

  • So, you want differnt size objects with the same behaviour, ie same mass?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's the thing... I don't want the heavy objects to be knocked aside as easily as small objects, but I do want them all to travel at the same speed. That's why ideally I would like a change gravity direction setting... but it doesn't appear to exist.

  • try to manipulate the Friction and linear damping.

    Well you are trying to change the laws of physic ;-) and that's what the physics engine probably is not able of.

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