Quantcast
Channel: Questions in topic: "ignorecollision"
Viewing all articles
Browse latest Browse all 148

How to ignore collisions with certain objects under a condition temporarily?

$
0
0
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

Viewing all articles
Browse latest Browse all 148

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>