![]() When 3D is selected as the default behavior mode, images are recognized as type Texture. If you have an existing project in Unity or aren’t sure if you’ve selected 2D from the project dialog, you can set your project defaults for 2D by going to Edit | Project Settings | Editor otherwise, you’ll have to manually set the texture type on every 2D image you import, which is a bit tedious if you have a lot of artwork. You can change the default behavior mode at any time, which affects only future importing of images into your project. ![]() I recommend trying this out and seeing how your camera’s viewing area changes when you start moving objects further away into the Z axis. You can change the mode simply by selecting the camera and changing the projection type. There are various reasons to use one camera type instead of the other, but in general, choose perspective if you need visual depth, unless you want to scale your objects accordingly. The other camera type is perspective, which shows objects as our eyes see them, with depth. This camera type, which is commonly used in 2D, doesn’t scale objects further away as your eyes would see them that is, there’s no depth from the camera position. The highlighted camera is set up as an orthographic camera, one of two camera modes in Unity. I have the camera highlighted so you can see an outline of the camera’s viewing area, but note that it looks out into space as a rectangle shape.įigure 1 2D Mode Selected-Camera Has Focusįigure 2 2D Mode Not Selected-Camera Has Focus Figure 1 and Figure 2 show the 2D mode selected and not selected. A 2D game in Unity is really still a 3D environment your work is just constrained to the X and Y axes. You can click it at any time to pop in and out of 2D working mode. This really just provides a helper button that fixes you to two axes during scene development, but has no effect in your actual game. (I’ll cover this in the next section.) Also, the scene view defaults to 2D mode. When you do, project defaults are set to 2D (viewed under Edit | Project Settings | Editor) and any images imported into your project are brought in as sprites as opposed to just textures. To get 2D support in Unity, when creating a new project you select 2D from the dropdown in the new project dialog. That’s some of what Unity 4.3 brings to the table and in this article, I’ll discuss more of its features while developing a basic 2D platformer game to learn some essential Unity concepts. What I want is to just drag and drop an image into my scene and have it appear and work as I’d expect via a drag/drop interface. You could do 2D in Unity before 4.3, but the process was quite painful without a third-party toolkit. In this article, I’m going to explore 2D in Unity, which builds upon the 2D support Unity added in version 4.3. In the first article, I covered some Unity basics and architecture. Volume 29 Number 9 Unity : Developing Your First Game with Unity and C#, Part 2
0 Comments
Leave a Reply. |