Hey there,
I’m still working on a 2D Infinite Runner, and currently I encountered the following issue:
I scripted and created the 2D Character as in the Tutorial of the Learning section, which means I gave him 2 different colliders: 1 Box collider with a slippery material and 1 circle collider for the ground detection. For the game I want to limit the amount of collisions the character may have with obstacles to 3 which I already did, but the issue with the collisions is, that it will always count both colliders in. So if the character enters the trigger of an obstacle, the count will increase by 2 because of the 2 colliders.
I’ve already thought about the Physics2D.IgnoreCollision method to limit the count to the boxcollider only, so that only 1 collision will be counted. But then his feet may touch an obstacle and nothing happens which bothers me…is there any other way to make it count both collisions as one?
The second issue is, that I’d like to slow down the character after a collision, but I don’t know how…I’d tried to change the rigidbody2D.velocity.x, but nothing happens…
If somebody could help me, that would be great!
Thanks in advance!