Physics issue - change settings or..?

  • Hello.

    I made this sample:

    mediaconceptfactory.com/testgames/TestBucket

    Capx:

    mediaconceptfactory.com/testgames/TestBucket.capx

    If you move the bucket really fast the blocks will just go right through the edges of the bucket.

    The bucket has standard 'physics' settings. I was wondering which to change to what to prevent the blocks from going through the edges of the bucket?

    I tried making the edges thicker but that didn't do anything. Setting 'Bullet' to 'Yes' in the Physics properties of the block doesn't seem to work either.

    Any solutions?

    Thanks.

    - R

  • It's not a good idea to mix Physics with other behaviors like Bullet, Drag&Drop, Pin etc. Also, Physics objects don't like sudden and sharp changes in movement.

    I made a similar demo for another post, where a clone "fake" stationary bucket is used to simulate physics:

    dropbox.com/s/z4hm5wqt4g7fe1z/apples.capx

    You can improve it, make it look more realistic by applying small forces/impulses to the clone bucket, in the same direction where the primary bucket is dragged.

  • Hi,

    Thanks for your reply.

    Honestly I'm not sure how else I'm supposed to recreate the Drag & Drop and Pin behavior. Both are needed for gameplay and to keep the components and a graphic together right?

    I chose physics because that seemed to be the most obvious solution.

    The demo you created actually works out the same as mine, perhaps yours has a slight less chance of the apples going through the edges. But it still does if you move the bucket fast enough. Even had a few frozen apples on screen.

    Also I'm a bit confused; why there are two buckets; one stationary and one moveable? Are they supposed to work together? I don't unerstand.

    Or perhaps more importantly, what can I use to simulate physics without using physics!

    - R

  • The red bucket is the one you use to catch apples. It doesn't have Physics behavior.

    The green "clone" bucket is stationary, it can be invisible or off-screen. This bucket and apples in it have Physics enabled. The green bucket is used to simulate natural physics movement of apples falling into the bucket. Positions and angles of these apples in the green bucket are then replicated for apples in the red bucket.

    My example doesn't allow apples that are already inside the bucket to fall through the walls when you are moving it too fast. It still needs tweaking of course, for example when an apple is hit by the outside wall of the bucket, it should bounce off (currently it may get inside the bucket). You may also want to limit the maximum bucket speed etc.

    I made some changes to the file, please re-download it:

    dropbox.com/s/z4hm5wqt4g7fe1z/apples.capx

    .

    You can try a completely different approach. In your original file, instead of using Drag&Drop, move the bucket with Physics actions - Set Force, Set Impulse, Set velocity. It will probably be less responsive, but collisions with apples should work much better.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi dop2000,

    I looked at your updated capx, but I think the programming there is way over my head.

    I'm not sure how to go about limiting the bucket movement speed of the drag and drop. Seems like a good solution, although I really wish I didn't have to.

    As for using the solid for the bucket, with the bullet for the falling objects, I also tried that idea, but seems like the bullet object will even go through solids as well.

    How would I go about moving the bucket with physics actions with user mouse/touch input?

    Thanks again :)

    ::Referenced you after edit, not sure if it works.::

  • Try this example to see how you can move Physics objects with mouse:

    dropbox.com/s/9cdcj8omeurgsjh/pendular-movement_dragndrop.capx

    With Physics is always trial and error, you need to try lots of different things and settings to find the best working combination.

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