[BEHAVIOR] Chipmunk Physics

From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • Thank you R0J0hound and Prominent . I'll try and compare both methods, but I think you're probably right and going physics all the way is the best way to go. I'm new to Chipmunk Physics so it's all quite intimidating and I will need to find good tutorials / examples to get started, but if I can get it to work it should help fix a couple of other problems I'm currently facing with my game idea. Thanks again!

  • Prominent

    Waltuo

    I posted this a few pages back, might be useful: https://dl.dropboxusercontent.com/u/523 ... pe_v2.capx

    The elevator/moving platform thing, i just did that by giving it a high mass & directly setting velocity, there didn't seem to be any problems with deflection on impact, & when it stops moving it's set to immovable.

  • mattb That looks great and will no doubt help me in understanding how to use physics instead of platform behavior in my project! I will definitely be studying this, thank you!

  • The elevator/moving platform thing, i just did that by giving it a high mass & directly setting velocity, there didn't seem to be any problems with deflection on impact, & when it stops moving it's set to immovable.

    That method places limitations on what I can do. I'm trying to find a solution that maintains all the physics qualities but can cancel out forces from specific objects.

  • R0J0hound , I just noticed that if both objects colliding have prevent rotation set to Yes, the collisionImpactX and Y always return 0.

  • Prominent

    Here's an idea using collision layers. The idea is the elevator is two different objects on different layers so they don't interact. So for example the orange blocks can affect the elevators motion, whereas the blue one thinks it has high mass.

    https://dl.dropboxusercontent.com/u/542 ... ator2.capx

    Outside of that idea more of chipmunk's collision handlers would need to be exposed. Then maybe tricks like setting the mass high temporarily before the collision is resolved and then setting it back afterwards could be used.

  • R0J0hound , ah! thanks. I was able to apply those concepts to my project, and it's working now!

    Just curious though if you know, why would the collisionImpactY return 0 if rotations are prevented?

  • Prominent

    Not sure. All prevent rotation really does is give the object super high rotational inertia.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Once again, R0J0Hound dishing out the tasty treats. Thanks for the great behaviour!

  • How can I handle collisions between fast moving objects, like the Bullet yes/no in the official physics behavior?

  • How can I handle collisions between fast moving objects, like the Bullet yes/no in the official physics behavior?

    Giganten Use Chipmunks physics on the bullet object (there's no need for you to use bullet behaviour I think, the chipmunk should suffice).

  • Giganten

    The chipmunk physics library doesn't support that. If you want it for something like bullets then ray casting might work for you.

  • okay, was trying to use it for fast moving balls, like a pinball game.

  • How would one go about creating a button/switch tile in chipmunk physics that is pushed down when another physics object is on it and lifts back up after other object is not on it anymore? Do I need to set up some kind of joint for it to bounce back up or what would be the best approach?

  • Giganten

    I've found that as long as physics shapes are fired & deflected using forces or impulses the collisions are ok (for realistically high speeds, I haven't tried super fast). It's only when you set velocity manually that things start intersecting a lot, so avoid that if you can.

    Waltuo

    This is how I'm doing buttons in a platformer where they're triggered by physics. No chipmunk on the button, just overlap testing:

    https://dl.dropboxusercontent.com/u/523 ... events.png

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