Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Astreos · Jan 21, 2012 at 03:56 AM · 2dspritehex

2d tool required for simple sprites?

My project will be a 2d hex turn-based strategy game. Units will be simple .png sprites (not animated) that will move from one hex tile to an other.

My first question is, do I need any 2d tool (like 2d toolkit or ex2d) to achieve this or I can do it with the tools that Unity offers? Do you suggest to use iTween for the movement?

Do you have any suggestions of how to put my .png files on the tiles of the the hex board dynamically with code? Can I have, for example, a link to the .png file in my Unit class and then assign it to a generic prefab and then put that prefab in the board?

Thanks for your time and suggestions

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Alismuffin · Jan 21, 2012 at 04:35 PM

You can place a 2D camera in your scene (Simply switch perspective to orthographic in camera settings) then place the 2D Sprite on a plane or cube. Change the cube material settings to Transparent>Cutout>Diffuse. This will mean only the texture will be visible, not the rest of the mesh. To make the sprite clearer than it is when imported you can click on it in the project tab and change the import settings. Change the filter mode to "Point". This will give a crisp image. To use code to assign textures to the tiles you could create a texture variable in your code and have a look at how to change the materials texture to the one you want. Or alternatively use code to adjust offset values and have a sprite sheet. To move the sprites you could simply use transform.translate.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Astreos · Jan 21, 2012 at 10:50 PM 0
Share

Thank you, kind sir, for your response. Cube looks very interesting for a base for the bitmap. I pressume that with the cube will be also easier later, when I'll try to find a way to select the unit to move it. As for the plane, correct me if I'm wrong, but cube is better, because it has less polygons?

avatar image Alismuffin · Jan 21, 2012 at 11:48 PM 0
Share

I prefer to use cubes simply because it's easier to detect collisions with imo. Good luck with your game!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Tilemap with irregular sprites? 0 Answers

Bounds.extent relation to localScale 2D 0 Answers

2D Character getting a weapon. Changing it's sprites/animations 0 Answers

2d Spaceship editor? 0 Answers

In-Game 2D Sprite Building System 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges