Hello Guest

Author Topic: 2D Sprite Sizes in a 3D Environment?  (Read 4482 times)

ryanray

  • Newbie
  • *
  • Posts: 2
    • View Profile
2D Sprite Sizes in a 3D Environment?
« on: April 26, 2013, 07:37:11 pm »
Hello,

I'm currently learning everything I need to know about using Unity as well as 2D Toolkit in order to create a game combining both 2D and 3D. The environments will be 3D while the sprites and background will be 2D.

My question is regarding the physics engine in Unity and how there is a specific size requirement for objects to be able to function properly with Unity's physics.
I understand that in Unity, 1 Unit = 1 Meter, so with that in mind I created a 3D object about 2 meters in height and 1 meter in both length and width as a character size reference. I then created a character sprite with a size of 256 in length and 512 in height. Once imported, I placed both of them into a scene with the scale set to 1 in all axis for both objects and saw that the sprite character was very close to that of the 3D size reference, so I knew I was on the right track. However, I know that if I were to create many sprites at the this size it could end up creating many atlases which could become a possible memory issue in the future.

When combining sprites with 3D environments in unity, is it necessary to stay within Unity's measurement system, or would I be able to get away with creating smaller sized  characters and not create any issues with the physics?
I honestly have no problem creating sprites at the large size mentioned above, and I would actually prefer it, but as mentioned I plan on creating many sprites, and would like to avoid risking any issue with memory or atlas sizes.

Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Sprite Sizes in a 3D Environment?
« Reply #1 on: April 27, 2013, 05:13:51 pm »
About sizes & physics. If you don't want to have to fiddle with Unity physics settings, make things considering 1 unit = 1 meter.

When you create a character sprite, you want to create it so the final sprite size fits in with the scene. It doesn't matter how you achive this, bigger images, or indeed, by tweaking the ortho size in the sprite collection. The physical size of the sprite is a function of the size in texture space, but this is controllable using the ortho size / resolution pair.

1. Create your sprite at the resolution you want to - don't care about on screen resolution at this point, just how much texture space you want to allocate to it.
2. Create your sprite collection and place the sprite in the scene with your 3D objects. Tweak ortho size in the sprite collection settings and commit - you should see the sprite physically change size in your scene. Tweak until you're happy with it.