Number of current collisions

jb15jb15 Member Posts: 602
edited November -1 in Working with GS (Mac)
Is it possible to know how many actors are colliding/overlapping actor x at one time? For example, there are 2 actors overlapping actor x right this second. If another collides with actor x, then the total becomes 3. But if all leave, back to 0.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you could have magnitude set up on each actor based on its self position and actor x. then have another attribute that changes to 1 when its in the magnitude zone and to 0 when its not.

    Have that for each actor, with each actor having its own attribute that switches between 1 and 0 depending if its close enough.

    then you can check those attributes and however many are 1 you'll know how many or overlapping. So if 2 of the attributes are 1 and the other ones 0 you know 2 are overlapping. Not sure if thats the best way thats just off the top of my head as im running out the door.

    You can also check to see if positions match up and tell that way
  • jb15jb15 Member Posts: 602
    OK--I'll do some experimenting with that method. Thanks John!
Sign In or Register to comment.