[BEHAVIOR] Chipmunk Physics

From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • Badmiracle

    Usually if both objects have the behavior, the knock back is automatic. Or if you want it to be more severe you could apply an impulse on post collide. If one object doesn't have the behavior you can still apply an impulse.

    Apply impulse at offset just makes for some wack behavior - sending objects rotating rapidly, and not stopping... how do I just make a simple knockback and what else do I have to adjust to prevent the impulse for remaining forever

  • It seems that object.Chipmunk.ContactCount doesn't return anything, alongside with other expressions that are supposed to, why is that ?

  • Prominent

    Sorry, I haven't had a chance to look into it yet. It's probably one of many edge cases I haven't handled.

    Badmiracle

    When using the apply impulse action the first vector is the impulse and the the second is the offset from the center of mass. Leave the second one to 0,0 and it souldn't add rotation.

    X3M

    Those expressions only give values under the pre/post collide triggers or under the "for each collision pair" condition.

  • R0J0hound

    Is there a layout size above which Chipmunk stars loosing precision/becomes unstable? I managed to find this thread:

    https://chipmunk-physics.net/forum/view ... f=1&t=2771

    which states that Chipmunk uses double precision, so layouts of around 100K in size should still be fine, right?

  • R0J0hound - Unfortunately it is not working for me on the latest version of C2 and fails to load with the error:

    Found " 'GetPluginSettings' global, but it is not a function "

  • R0J0hound - Unfortunately it is not working for me on the latest version of C2 and fails to load with the error:

    Found " 'GetPluginSettings' global, but it is not a function "

    adcornaglia

    Are you certain you installed in the 'Behaviors' folder and not the 'Plugins' folder?

  • FunkY Koval

    In JavaScript all numbers are double precision, so I doubt it's an issue with a layout that size. It would be the same with any other behavior.

  • > R0J0hound - Unfortunately it is not working for me on the latest version of C2 and fails to load with the error:

    > Found " 'GetPluginSettings' global, but it is not a function "

    >

    adcornaglia

    Are you certain you installed in the 'Behaviors' folder and not the 'Plugins' folder?

    That was it.

  • R0J0hound I'm testing the plugin and not see "compare velocity" in the physical ... that this plugin is the alternative?

  • statham

    I purposely didn't add and conditions to compare expressions of the behavior. You should use system-> compare or pick by comparison with the expression to do it.

  • I wanted to make an object with physical and when stopped, would make an animation

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • statham

    You can still do that as I said.

    Add a new condition:

    System -> pick by comparison

    Select you Sprite as an object type and use the expression Sprite.chipmunk.speed to get the speed.

  • R0J0hound , I found an issue with the ignore collision stuff.

    If physics object uses collision polygon, and sprite is animated, then it won't ignore a collision in cases where you just want to collide when jumping ontop of it. For some reason when a frame changes(even if polygon remains same shape), it collides each time I think, which ends up make it seem like you collide from the top even though you aren't.

    Here's a capx: https://1drv.ms/u/s!AhHSZHEulqh_gXKKkewSu_0hXMDg

    Any idea on how to get around it? or is this just a limitation we have to deal with?

  • Prominent

    I can't open your capx right now but when the animation frame is changed the collision shape is recreated. The only way for it to know if the collision polygons of two different frames are the same is to compare all the points, which may be slower than just recreating it. Also note changing size also causes the collision shape to recreated as well.

    So to the physics engine it's a new shape, so it causes a new collision. I guess a workaround in the plugin would be to modify the collision shape instead of recreating it, but there are many caveats with that, and that's something that's absent from the chipmunk documentation so it's not really something it was designed to do.

    Anyways the solution is to not change the frame on physics objects. If you want to change appearance, use a seperate object.

  • thanks for the info- makes sense. I'll use a separate object.

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