mohsen.nikroo Posted March 4, 2013 Posted March 4, 2013 Hi I need to measure the distance between two objects I want to shoot a ball to the target and when ball close to the target, The target destroyed. ----- Note: the target object is movingI can not use contact callback.
manguste Posted March 5, 2013 Posted March 5, 2013 You can try out one of the following variants: Use on of engine.world.getIntersection* ray-tracing functions (there a re different implementations with filters, etc.). After that, calculate the distance based on a vector via length(). Much more simpler variant is to use PhysicalTrigger. Make it a child node of the target, and each time a ball will come close, a callback will be fired.
Recommended Posts