- Home /
Question by
WhenDidIAskBruh · Feb 08 at 01:22 AM ·
collidercollision detectionlayermask
IsTouchingLayers Not Returning True Despite That It Should
I am using IsTouchingLayers on one collider to detect if it is touching other colliders of a certain layer, however despite the colliders very obviously touching in the scene view, IsTouchingLayers simply wont return true. I've googled this question for a while but can't find anything that helps. Here is my code:
bool CheckValidPlacement()
{
if(selectedTowerImageToDragCollider.IsTouchingLayers(trackLayerMask)||selectedTowerImageToDragCollider.IsTouchingLayers(towersLayerMask))
{
Debug.Log("Is Touching Another Collider");
return false;
}
else return true;
}
Comment
Are you 100% sure they are touching? does a OnCollisionEnter2D work?
Your answer
Follow this Question
Related Questions
Character controller not fitting through door 0 Answers
Best way to implement splash colliders? 0 Answers
one collider for 2 combined object 2 Answers
Detect collision point?? 1 Answer
How to reliably break contact/collision? 0 Answers