Game Development Community

Getting a list of collided objects from a behavior

by Fredric Echols · in Torque Game Builder · 11/16/2008 (7:17 pm) · 0 replies

Hello,

What is a good method for obtaining the list of objects that have collided and are currently "stuck" to a given object?

The scenario here is to create a "scale" that the player can drop blocks onto. The scale will weigh the blocks to show the total weight.

The complication is that blocks may be stacked on top of each other, so they may not all be touching the scale object directly.

Is there any method to iterate through a "chain" of connected objects that are stuck together using the built-in sticky collision response?

If there is no easy way to determine connectivity, is there a best practice method for accomplishing the same thing, perhaps by attaching a behavior to each object that would maintain a list of objects that are touching it, thereby creating the connectivity graph?

Is there some other, simpler, method that would work entirely differently from the ideas above?

Thanks!

(From a TGB newbie.)