Recently, I have been making a game about parkour to escape a flood, and the flood is not working at all. I want the player to go through the flood so I have turned off box collider but than the player can’t take damage by touching the flood. Here’s my code:
I have also tried OnCollisionEnter but it’s not working too. Help plsssss
Does it have a rigidbody? From memory it needs one for trigger to work.
If character can’t pass through your “flood” collider, then it is probably not marked as trigger. You have to check IsTrigger checkbox on the collider component.
And yes, in order to collide with a trigger, the character itself needs to have a collider and a rigid body attached.
For simple colliders you can also do the math manually. Checking if character’s position located within a box of specific size is fairly straightforward.
Oh It doesn’t have one, but I want the flood to move using transform and it need to move through walls so I turn off collider but than it cannot detect collision.