- Home /
Player falls through ground after adjusting pixels per unit of the players sprite
I am very new to unity, so when i first started a couple weeks ago, i imported a sprite for my main character to the game-project. I set the "pixels per unit"-variable to 128 (I just did, i dont know why). Then i imported a ground sprite, 16*16 pixels, so i set the "pixels per unit"-variable to 16. After putting both of the sprites into my scene, i learned how the variable works, because i saw my player being really tiny. I used local scale option to resize my player, setting both x and y to 8. The player now had its correct size. I worked on the game with this configuration. The player now can jump (once, when he is on the ground), and run left and right. Pretty basic, and its working all fine. I decided to correct my little mistake from the beginning and set the "pixels per unit"-variable to 16 as well, so can use the default local scale again. Everything looked the same afterwards.
For some weird reason, my player is falling through the first block of ground ALL THE TIME, and if i jump and dont move left or right, i fall even through the next block. I did put my grounddetection to the bottom of the players feeds.
If i change it back to the 128, its working fine again. I even tried to set the collision detection to continous, because i read somewhere it helps with fast elements, which sometimes fall through ground. It didnt work, either. My player isnt falling very fast to be honest.
Someone any solutions or ideas, to fix this problem?
Your answer
Follow this Question
Related Questions
Gravity keeps my player from moving 1 Answer
How can I make a 2D object that apply gravity inside a hollow circular ? 1 Answer
Issues using physics for 2d platformer. 3 Answers
Check if circle player is on the ground 4 Answers
2D Colliders bug. 1 Answer