Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!


OverviewFelgo 1 Support › How to get collision impulse

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #5561


    Hi all,


    I want to decrease player’s health in case of a collision. In the docs (BoxCollider) it is suggested that one could use fixture.onBeginContact to start a timer which decreases health periodically as long as the collsion happens. This approach doesn’t seem to take the force of the collision into account. So I think, touching something softly but for a long period of time is more unhealthy than colliding with high speed and bumping off. Box2D offers the normal impulse (“The normal impulse is just the normal force multiplied by the time step.” [Box2D manual]). Is it possible to access this property in Felgo? Is there another solution?


    Thanks for any advice, cheers




    Hi Thomas,

    you can see Ball.qml of the VPong demo which uses circleCollider.body.linearVelocity to determine the velocity of the ball which is decreased when it hits another object. There is also a counter available which increases the final force of the ball when the limit is reached. A combination of those properties could also be a solution for your Problem. Furthermore, you can start the timer with fixture.onBeginContact and stop it in fixture.onEndContact so you can also use the information for the duration of the collision.



Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.