Temporarily turning off colliders

Hello,

I have a small issue I can’t seem to figure out.

The Scene: The player (has a character controller) touches an enemy (also has a character controller). The player and the enemy collide with each other preventing movement from both objects.

Desired Result: When the enemy touches the player, the enemy goes through the player not blocking/stopping the movement on both objects. After x time, collider is turned back on. In addition, I’d like for the enemies to still be effected by the walls and ground.

I have tried the decectCollisions attribute

but that didn’t work.

Any thoughts on how I may solve this minor problem? Even pointing me at a function/attribute will help.

Thanks,

-S

Did you try this?

@Leonsito
Thanks, I’ll check that out now.

-S

@Leonsito
Thanks for the tip. I actually used Physics.IgnoreLayerCollisions since all of the enemies are in a layer anyways. That gave me the desires result.

-S

Nice, that was the other option, well done :slight_smile: