#how do i use collision list

6 messages · Page 1 of 1 (latest)

wind raven
#

so i've been trying to use collision list to check a collision in a line and do stuff based on what objects are detected and how close they are in the line but i just can't seem to get this to work

i don't know if im looking in the wrong direction or not but i can't find anything about using collision list and checking if a specific instance among the group is hit

can someone help me pls

spice fox
#

it should be inside a loop and you cannot check it "case obj_wall" like this because lists returns "id" so you need to add this to your switch;

for (var i = 0; i < prediction; ++i) {
  switch (_latchableList[i].object_index) {
    case obj_Wall : /* YOUR CODE ETC */ break;
  }
}
#

after you write what's above, you can delete the "if (prediction >= 0)" line, for loop already taking care of that

wind raven
spice fox
#

switch system already doing that

#

only the wanted case will work