2D Development in Unity
Table of Contents
Pixel Perfect discussion
So on a screen height of 1080
with orthographic size of 5
, each world space unit will take up 108
pixels (1080 / (5*2))
. It's 5 * 2
because orthographic size specifies the size going from the center of the screen to the top.
Therefore if your Sprite’s Pixels Per Unit (PPU) settings is 108
, it will be rendered nicely.
Orthographic size = ((Vert Resolution)/(PPUScale * PPU)) * 0.5
Physics 2D reference
- A Kinematic Rigidbody 2D does not collide with other Kinematic Rigidbody 2Ds or with Static Rigidbody 2Ds; it only collides with Dynamic Rigidbody 2Ds.
Sprites reference
Packer
- file:///Applications/Unity/Unity.app/Contents/Documentation/en/Manual/SpritePacker.html
Edit
->Project Settings
->Editor
Window
->Sprite Packer
- Required to specify a Packing Tag in the Texture Importer to enable packing for Sprites of that Texture.
Use Transform.up in 2D as forward howto
In 2D, you want to do your rotation in the Z-axis, and instead of .forward
use .up
or .right