hi to all!! for programming needs I can not change the layer of this object ... it is a stone that the player can destroy, some enemies change direction if they collide and others that should pass through .... Now.. how do i allow an enemy to pass through??? whit this not is possible Code (CSharp): Physics2D.IgnoreLayerCollision(12, 12); because the object is on the ground so if i change layer the object will fall through the floor the code i showed "12,12" it's the enemies layer because they have to cross each other so i was thinking of using this code Code (CSharp): private void OnCollisionStay2D(Collision2D stay) { if (stay.gameObject.name == "Smallrock") { } } but I noted with disappointment that I don't have an "ignore collision with this object" or similar command Could you please help me how can i do this??? thank you in advance
Why can't you have 1 layer for the default and 1 layer where everything can pass through? Then you only need to switch the layer without touching physics in code
because if I change its level when the player walks over it it won't detect it... and it will stay with the jump animation... the object is now on the ground