Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business


OverviewFelgo 1 Support › Check if entity has stopped moving

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



    I wanted to know whether there is a possiblity to check if an entity has stopped moving?

    My Situation is as follows. The balls we shoot at birds get removed after they touch an invisible border at the bottom of the field. Now we have levels in which the balls are used e.g. to close gaps or maybe later on to activate a switch. In this case, they will never fall down and will never get removed. My problem is now, that our game ends, when all the balls are removed -> so the game never ends.

    And thats why I need to find out whether the ball has stopped moving, cause it is in a gap or on a switch, so that i can decrement our shotsInTheAir variable and the game ends without these balls being actually removed.


    Felgo Team

    Hi Saims,

    you could use the active property of BoxCollider to detect if a physics body is moving or not. You could disallow an entity getting inactive by setting the sleepingAllowed property to false, but by default it is true.

    Another approach might be, to not only decrement your shotsInTheAir counter when the balls are colliding with the border, but also when they collide with the other physics objects where they can come to a halt. Or you start a timer after issuing the last shot and stop your game if either all balls are out of range, or the timer is finished whatever comes first.

    Cheers, Chris

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

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded