[Physics] More realistic Drag&Drop movement?

0 favourites
  • 5 posts
From the Asset Store
2D realistic cloud pack has 11 different clouds included.
  • Hi,

    I'm trying to make a physics game. Part of it involves draggind and dropping different shapes. My problem right now is to make objects act more realistically when I click and drag them. I need them to understand where I clicked and act accordingly. Let's say I have a width 10 x height 2 plank and i click on the left side of the plank and start dragging. The right side of the plank should ofcourse fall because the laws of the physics. I can't achieve that on my own so I need your help on where to look...

    Also, if there's no way to do that, is it possible to get more realistic results with multiple image points or something?

    Thank you!

  • super duper simple easy peasy.

    Create a physics Object on touch. hinge joint the plank tot he physics object. drag on the physics object around. Make sure to use strong forces on the physics object and NOT set position. the hinge joint on the plank will create the effect your looking for.

  • Just wondering, jayderyu, if you know of an equation that could give a smooth non-revolvey movement?

    I've been using this formula...

    ((distance(Objects.X,Objects.Y,Cursor.X,Cursor.Y)^2 / 500 + 10) + Objects.Physics2.LinearDamping * sqrt(sqrt(sqrt(distance(Objects.X,Objects.Y,Cursor.X,Cursor.Y))))) * Objects.Physics2.Mass / 100 + sqrt(distance(Objects.X,Objects.Y,Cursor.X,Cursor.Y))

    But I think that's probably a bit overkill, and it can most likely be factorised / simplified as well.

    Edit: You'd be surprised how well it works though =P

  • Thank you for your input!

    OK.... I have no idea (I played with joints but no luck for me) how to implement those in to my project. I'm newish with C2. I'm not looking for someone to do it for me but... If it's not too much to ask, a small example would help.

    For clarification, my layout consists of 5-15 planks (french fries) and a ball (meatball, ofcourse). Player has to make a somekind of tower from the draggable french fries and then get that platformer meatball to climb to freedom. Best idea for a game, I know.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ...and everything else kind of works but I just want those fries to act normally

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