Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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
0
Question by AdamAndersson · Jul 17, 2015 at 09:42 AM · 2dspriterenderermasktiles

Best approach for triangle tiles using Sprite Renderer for a 2D platformer

Hey everyone!

I'm currently making a 2D side scroller game, a la. Super Mario. To build the levels I use tiles and each tile is a game object with a sprite renderer attached to it. Walkable/intractable tiles have a box collider on them. All of the sprites are atm squares.

I want to add tiles that are shaped like triangles to my palette of tiles to choose from. I have been considering two options on how to do that:

1) Add one sprite for each triangle tile. One square sprite will therefore have 5 different sprites and variations, one square and 4 triangles (left slope up, left slope down, right slope up, right slope down). This solution will work. However, it will be a lot of extra work to add and maintain all the extra sprites. More sprites means that the application size will be larger AND there will be more atlas pages, resulting in more draw calls.

2) Using a mask in order to only show parts of my existing square sprites. Something along the lines of this: http://forum.unity3d.com/threads/released-sprite-mask-masking-system-for-unity-sprite.292453/ This solution would be easier to maintain after implementation and I would not need to worry about different variations of sprites. However, maybe the implementation will take a long time. Maybe there are some other draw backs like extra draw calls, performance, etc.

So what is the best approach considering performance and maintainability? Anyone had the same experience and faced the same design decision? Are there any alternative approaches?

I appreciate all the input I can get :)

Thanks!

Comment
Add comment · Show 2
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 Oribow · Jul 17, 2015 at 01:03 PM 0
Share

Cant you just rotate the sprite?

avatar image AdamAndersson · Jul 18, 2015 at 09:38 AM 0
Share

No. The sprites are at the moment tiling seamlessly, which will break if i rotate them.

0 Replies

· Add your reply
  • Sort: 

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

22 People are following this question.

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

Related Questions

How the change the sprite image of spritemask according to the sprite image in that object animator? 0 Answers

Crop/Mask a Sprite on runtime 0 Answers

Confused about ITilemap interface and concrete tilemap classes 0 Answers

Unity 5: MeshRenderer and SortingLayer not working? 6 Answers

Why is my sprite not the original resolution? 2 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