Find impact or speed of an falling object

0 favourites
  • 5 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hi,

    Is there a way to find out what the impact of a sprite is when it falls down and hit the floor? or the speed it was moving just before it hit the floor?

  • If you use the platform behavior you can use 'vector y' (pixels per second).

    + Player: Platform is falling

    + System: impactSpeed < Player.Platform.VectorY

    -> System: Set impactSpeed to Player.Platform.VectorY

    you have to set the variable impactSpeed to 0 by the beginning of every falling:

    + Player: Platform On fall

    -> System: Set impactSpeed to 0

  • It's a physics game so I don't know if the platform behavior works well with the physics behavior?

    But I'll give it a try! Thanks Asmodean!

  • I wouldn't mix platform- and physic-behavior. That can cause bad side effects.

    The physic-behavior has 'VelocityY' what you can use.

    + Player: Is overlapping Ground at offset (0, 20)

    + System: Trigger once

    -> System: Set impactSpeed to Player.Physics.VelocityY

    It's not so elegant, but it works. The problem is the elasticity of your falling object. It jumps several times when it hits the ground.

    You have to tweak the offset of the overlapping. It depends on the elasticity and the size of the falling object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It works quite well. There indeed a little bounce but that is not a big deal.

    Thanks again, you helped me alot!

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