playMaker

Author Topic: test if collider on objectname X is colliding with collider on objectname Y?  (Read 109 times)

westingtyler

  • Full Member
  • ***
  • Posts: 125
    • View Profile
my player is tunneling block by block.

when my player clicks on the wall's box collider, I need to check the 4 box collider triggers around the wall to see which one the player is standing in (so i don't build an unnecessary wall IN the player.) I'll also check the box colliders around the wall clicked, to see if those invisible colliders are in another wall already, or if a wall NEEDS to be created there. this will ensure new walls are generated ONLY where there is empty space.

Basically, it's a tunneling system like in Dungeon Keeper, using rectangular walls with no up or down tunneling.

I can't just 'get collision info', because a rat might have run onto that area after the player moved into it, and it would then test the rat to see if it's the player standing there and say no, and make a wall in the player's face.

so I need to be able to check the names of objects standing in the collider trigger, to see if one is the player.
what is the best way to do this? does it need a new action?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 1969
    • View Profile
Hi,
I am not really sure what you mean but maybe when the player moves on to colliders get it to store in an variable so you can check that one (or in an array so if you stand on 2 colliders

or maybe when checking each box, do a raycast on that position and see if it hits a player

or use the position of the box and the player to compare if it is in range of the box?

these are just some ideas out of my head, i can't test right now :)

westingtyler

  • Full Member
  • ***
  • Posts: 125
    • View Profile
thanks. i'll think about these, too.