[Physics] Impact Force

0 favourites
  • 5 posts
From the Asset Store
Build a thrilling space station scenario with these level assets and characters.
  • Hey,

    I'm making something simple with the Physics behavior. If the object hits the ground at too high speed, it's destroyed. Code looks like this.

    ->On Object Collision with Ground

    --->If Object Overall Velocity > 400 : Destroy Object.

    The object always hits the ground with 500 Velocity.

    In 50% of the cases, the object is destroyed on impact.

    In 50% of the cases however, the object is NOT destroyed.

    What I imagine is that sometimes, at the moment of collision the object's velocity gets reduced BEFORE the game can check for overall velocity on the next tick.

    Any idea how to go around this inconsistency?

    I suppose I can record the velocity in the last few ticks in an Array, like a black box, and check the last few entries from the moment before impact, but that seems quite cumbersome for a simple check.

  • The "Black Box" solution worked, but it's not really straightforward. Still looking for suggestions : )

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I guess you could always compare position (Y coordinate) with ground instead of checking "on collision with ground".

  • I'm extremely tired right now so I'm not sure I understood your question. But if you store the physics objects velocity in a variable when it collides, then compare that variable a short amount of time after you can tell if the hit was just a small scrape on the side, or if it was a head-on collision.

  • I guess you could always compare position (Y coordinate) with ground instead of checking "on collision with ground".

    The center of the Y coordinate is in the Origin Point of the object, which is in the middle. Since both object and ground are solid objects, they never cross.

    In addition, the ground has different heights.

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