Clone deletion[HELP}


#1

I was wondering on how to delete a clone that is not visible on screen without deleting the original

project: https://playcanvas.com/editor/scene/661029

PS: how do you detect collision from 2 triggers(not-rigid bodies)?


#2

As long as you have a reference to the clone entity, you can just delete it using the destroy method.

I don’t think there is anything to detect ‘collision’ between 2 collision components. At best, you might get a trigger leave and trigger enter event but I think that only happens when rigid bodies enter/leave a trigger.


#3

do it like this?setTimeout(e.entity.destroy(),60000);


#4

In what context? If it’s about destroying the bullet after a certain time, it may be easier for each bullet to keep track of how long it’s been active for any destroy itself after a certain amount of time.


#5

can you show me an example?