Pushing object with physics

0 favourites
  • 8 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I have searched through the forums with no solutions that has helped me. I worked on a game with my friend once until he gave up but at that time he figured out making physics work by basically having the player push the box to the wall so he can jump to the ledge.

    Whenever I toy with the physics, random things happen. I have read everywhere that the physics behaviour does not go well with other behaviours, but I really don't have a choice in that matter. The object will fall through the ground even with Solid and Physics behaviour so I had to add platform behaviour. And you were completely right about that physics don't go well with others. Basically everything started shaking and unexplainable sh*t started happening.

    Can anyone simplify what I am trying to do? (Having player push box to the wall by just walking on it and then jump on top of the box and then to the edge of whatever the player want to go to).

    I am just really having a bad time trying to figure out this, and I will greatly appreciate your help.

  • A solid object means it is solid only for other behaviors, no the physics one. If you want a solid physics object you have to add the physics behavior to your object, then change the Immovable property to "Yes".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A solid object means it is solid only for other behaviors, no the physics one. If you want a solid physics object you have to add the physics behavior to your object, then change the Immovable property to "Yes".

    Doing this will only result me going through the object. I want to push it like a solid object to the wall. I swear there was a really simple way of doing this by just messing with the physics and other behaviours but I completely forgot how. Even if it was immovable and a solid object, I still can't push it which is the main point. I don't really want drag mechanic just a simple push when I walk onto it.

  • I managed to find out what I did wrong but now I have a different problem.

    When I try push it, it barely moves (I have tried playing around with density and I know how that works), but when I walk backwards (by glitching the entire animation so it looks like i am walking right but instead i am walking backwards) it pushes it with no effort. I want this to be complete opposite.

    This is how it looks https://gfycat.com/GrotesqueKindIcelandgull

  • If you can provide a capx, it will be easier to help you.

    Do you use the sprite direction of the Player to set the force applied direction?

    If you reverse the force applied direction does it work better?

  • If you can provide a capx, it will be easier to help you.

    Do you use the sprite direction of the Player to set the force applied direction?

    If you reverse the force applied direction does it work better?

    I do not use any force direction. I use density for the player so he can push physics based objects.

    Here is the capx: https://www.mediafire.com/?84ob92jgwrfogy4

    I know you don't like any links other from dropbox, but I forgot how you uploaded a public file onto there so here is a mediafire one instead.

  • Mediafire isn't a problem for me but I had to install the last beta version of construct 2 plus 3 plugins that I had to find and install to open your project.

    To solve your problem, change the X origin of your Player for the moving animation to 50 instead of 55. (for the 4 frames)

    (Put the X behind the X center of your Player: if you put X=1 as your Player origin when the original sprite face right, your Player will be superman)

    One thing, you should set the same canvas size for all the Player moving frames, it will be easier for the origin. And you should improve the collision mask for the Player moving frames, this has an effect on the pushing.

    If you want to keep an origin at the center of your Player for any reasons, you will have to use another point to apply the force.

    From here

    [quote:1vttadjp]Point of application

    You can also supply an image point when applying a force. This allows you to apply the force from a different position on the object. By default, it's applied from the object's origin, normally in the middle of the object.

    If you don't understand let me know.

  • Mediafire isn't a problem for me but I had to install the last beta version of construct 2 plus 3 plugins that I had to find and install to open your project.

    To solve your problem, change the X origin of your Player for the moving animation to 50 instead of 55. (for the 4 frames)

    (Put the X behind the X center of your Player: if you put X=1 as your Player origin when the original sprite face right, your Player will be superman)

    One thing, you should set the same canvas size for all the Player moving frames, it will be easier for the origin. And you should improve the collision mask for the Player moving frames, this has an effect on the pushing.

    If you want to keep an origin at the center of your Player for any reasons, you will have to use another point to apply the force.

    From here

    [quote:1rgs6agw]Point of application

    You can also supply an image point when applying a force. This allows you to apply the force from a different position on the object. By default, it's applied from the object's origin, normally in the middle of the object.

    If you don't understand let me know.

    Well described and well informed. I understood everything you said. Thank you so much for teaching me on this issue!

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