This content originally appeared on DEV Community and was authored by sameer Dhyani
So after installing Unity you learn a thing or two.
What I learned was that there are four windows in Unity:
Hierarchy = The Hierarchy window shows a list of all the GameObjects currently in your scene.
Assets (Project Window) = The Project Window (often called the “Assets Folder”) shows all the files in your project — your textures, scripts, sounds, prefabs, materials, etc.
Inspector = The Inspector shows the details and properties of whatever objects or assets you’ve selected.
Scene View = The Scene View is your 3D or 2D workspace where you can see and edit your game world visually.
Okay, now there are various ways to add a character/player in Unity.
First, from the Sprite Renderer — now you may be wondering what is a Sprite Renderer.
Well, without any sort of complex explanation, the Sprite Renderer gives your character a body/visibility in Unity 2D games. Like, you create a player in the Hierarchy — the player is your soul, but the Sprite Renderer provides it a body. Simple.
Now that we know what is what, let’s get on with what is Rigidbody2D.
Well, in simple words, it provides us physics in our game like mass, gravity, etc.
Now you may be thinking — okay, let’s say that we have applied Rigidbody2D, but now our character only keeps falling, and we don’t know what to do after loading our player in Unity. Well, the same way you loaded your character using Sprite Renderer or Unity Store, you can get your platform or tilemap from it and make your platform.
Okay, now I hope you have done it, but wait — even though you have added a platform and player, your player got some abilities — abilities like a god, passing through the ground and falling endlessly. Well well well… it’s not magic or god tricks, it’s a simple component issue.
You see, without any way to tell if the player is touching the ground, Unity will think there’s nothing there and will make the player pass through the ground/platform. For that, we add Box Collider 2D.
What it does is make an aura around your player and ground, making sure that your character doesn’t fall off and making sure that the character is touching the ground or whatever you want it to touch. Simple as that.
And that’s it for today.
This content originally appeared on DEV Community and was authored by sameer Dhyani