I recently created and imported my own sprites into unity. I want to create a basic platformer to learn more about unity(I am still a beginner). When I put the sprites I created for a ground into Unity and attach a Box Collider2D my player falls right through. It looks like it doesn’t detect the collision at all. I want the player to stay on the ground and not fall through. I would greatly appreciate any sort of advice or solution to this problem.
Does your player have a collider2D and rigidbody2D?
Hi @Game_Krator
“I want to create a basic platformer to learn more about unity(I am still a beginner)”
Maybe watch Unity Physics / Physics2D tutorial videos, and then some platformer tutorials too? You can find several tutorials on these topics.
“I want the player to stay on the ground and not fall through”
You’ll have to have (most likely if you use physics to move your objects) Collider2D and RigidBody2D on your character, and the world objects too need at least colliders, no matter if those are GameObjects with spriteRenderer or a GameObject with Tilemap. Otherwise physics system has no idea that your moving object has collided with something.
Thank you both for responding. I don’t know what happened, but I deleted the game objects and then only added a box collider. I think my mistake was adding a rigidbody as well. I will probably watch some unity 2d physics tutorials to learn more.