Destroying an entity when it is stopped

Hello, I am a new Play Canvas member and I am not quite sure what code to use in my situation. I need to destroy an entity if it stops for 5 seconds. Is it possible to do that? (Also I have an urgent project due, so if someone could please answer me )

@Ishika_Saha This will depend on two different situations. Cloning or just enable/disable an entity in your hierarchy. This is the section of the API reference which should provide you with a good overview.

For timers I would take a look at these posts:

This is a specific timer to destroy a cloned object/entity:


This is a disable which make the entity disappear:

// Enter trigger
ItemPickup.prototype.onTriggerEnter = function(object) {

    if(object.tags.has('player')) {

        // play the pickup sound
        // increase the munitions amount

        // Increase item amount"player:addhealth",this.amount);

        // Disable after Pickup
        this.entity.enabled = false;


Hope this helps. Posting a link to your project will enable others to help you debug if you have issues.