So, it appears that there have been tons of questions relating to the CC collider not responding…
My situation works fine, except… a particular object will not call the method necessary when making collision with the PC if I walk up behind it as its moving away from my PC.
To understand more, this is a side scroller. You get power ups and jump on enemies, just like Mario. If I run up and collide with an enemy walking in the same direction, it will make contact (I die). If I do the same to the power up, which granted is going a little faster than the enemy, it will not respond. My PC just pushes the object and wont call the method.
Im using the exact same code to check for collision for both the enemy and powerup objects. I make this point because if I get in front of the powerup objects path, it does what its suppose to do upon collision. Why not from the other side? Any ideas what I could be missing here?
If you’re using the same code, this means that the problem is related to how you have the collider component set up or the actual position of the collider in the game. If it works from one side and not the other, I would assume that the collider needs to be scaled up a little bit. I’d also make sure that the powerup collider you are using has the “Is Trigger” boolean checked.
It’s possibly to do with the script you use. The way unity does checks for collisions is in sequence (seemingly random) which means that you can destroy/teleport/remove from contact one object in the collision then Unity checks for collision on the other side but the object it was colliding with is gone so nothing happens.
To fix this you should check for collisions in you OnTriggerEnter function then inside of Update or FixedUpdate have THAT call the function to do whatever operation you want if it meets whatever conditions you set it and then update the state of those objects all at once in update. That way you check all the conditions and then update all of For example.