I have a player with obstacles on the track. Normally, if the player collided with the object, the player would take damage or do whatever to slow down his progress, but if the player has a powerup, I want to make the player ignore the collision and just continue without slowing him down. I still want to detect the collision, because I want to play an animation on the obstacle flying away, but the actual "collision" I want it to ignore. Is there a way to do this? I hope I am clear about this. Thank you.
I also tried
Physics.IgnoreCollision(collision.collider, GetComponent(), true);
However, that would make the collision happen, and then then the ignore collision would be true. And also, I would have no way of turning this off afterwards
↧