[SOLVED] Player stuck in random places where no collider seems to be

Dear Unity-Community!

I develop my first game in Unity (5.5.2f1) and so far everything works fine,
but now I have a very strange problem and I hope anybody can help me:

As you can see on the first picture, all the Ground-Tiles have a 2D box-collider.

If I walk, the player stuck in air or in other random places where no collider seems to be…

But the problem seems to be here:
The collider of the right (and left) Tile is acting in the wrong place!

If I deactivate only this single collider, the player fall down and stuck in an other place.

The same issue happen on the other side of the platform…
Its very frustrating, cause I can not continue to develop my game with this nasty bug.

I’ve tried so much to fix it… With edge colliders and with one single collider for all parts together but nothing solved my problem and I’ve searched for a long time, but I’ve no idea how to fix this very strange issue…

**Sorry for my english and thank you for help :^) **

So how can i use the first line as value of x and second line as y?

2 Answers

2

If somebody have a similar problem, after three days I finally found the issue! And I was laugh about my stupidness. The player is not standing on this grass tile, he was standing on his own boundary. (I forgot to turn them to triggers)

Happy Easter!

The method returns an array where each item in the array is each line. Arrays are indexed starting at 0, so the first item in your array will be at 0 and the second item will be at 1. To get the first line as x and the second line as y, you would write: var lines = File.ReadAllLines("C:/Path/To/Your/TextFile.txt"); var x = lines[0]; var y = lines[1];

Can You Explain me in detail.,I Didn’t Understood.

Do you have an similar problem? If yes: I had two box-colliders on my player, one left and one right, to catch bullets so they do not fly forever. the problem was, i forgot to turn this colliders to triggers, so the player seemed to stack in unexpected places. You can see on the image, the right Boxcollider is grounded and the player stuck in air. Finally i've deleted these colliders and let disappear the bullets by Script, by Time with invoke a Destroy(gameObject) method.