How do I keep gravity constant while my object is moving?

0 favourites
  • 7 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • Long story short.

    Im simulating a falling object, and after X time has passed, the gravity is set to an X number so the object actually starts falling. The thing is, when the object is moved by the player, the gravity stops working, locking the object in the Y axis, unless left alone.

    Does anyone know what am I missing here?

    How do I make the object keep the gravity, without stopping when moved?

    Thank you for your time!

  • You can add this event:

    Every tic - set object gravity to x

    But what behavior did you use?

  • Attach a capx to your post.

    That will make it easier for anyone to investigate and provide help in return.

  • My apologies.

    I uploaded the .capx now.

    I added a little comment on it to try and explain the issue a little more.

    The goal is to have the object keep falling, even if the player moves the object.

    I apreciate the help!

  • Is the gravity the only reason you're using physics? If so, you could use the platform behavior (which has gravity) instead of the 8 direction and physics. You also wouldn't need the pin if you did this.

  • Yeah, if all you want is simple gravity, the physics behavior is way overkill. It's better to use something like platform or custom movement.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks a lot.

    Changing "Physics" for "Plataform" actually improved my issue and another one I had.

    This change lead to other possibilities and I ended up removing "Pin" too.

    Thank you for your help, guys!

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