Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Kaskorian · Jul 26, 2018 at 12:13 AM · tilemaptile

Teach the rule tile how to arrange tiles

Hey there,

I'm currently experimenting with the unity-extras, especially with the tile map extensions (Animated Tile, Rule Tile, etc.)

At the moment I am dealing with the Rule Tiles. And threre is one problem which I cannot solve. As an illustration I have 7 tiles that together make a clean transition of a wall.

alt text

I would like to teach the rule tile how to arrange these tiles based on the height of the wall (in tiles)

 1. with 3 or less tiles, use the first three or less tiles from the top
 2. at 4 - 7 use the first four to seven from below
 3. at 8+ use the whole column and  for the rest always the first tile

or something easier:

 1. at 1-7 use the first 1-7 from the top
 2. at 8+ use the entire column and for the rest always  the first tile

Does anyone of you know a way to implement that?

Looking forward for a reply

LG Kasko ;)

walls.png (6.4 kB)
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
0

Answer by wouter_v · Jul 26, 2018 at 05:37 PM

You'd probably have to make your own ruletile, you should look into how they actually work and extend them, i'm pretty sure they're just editor scripts. They supply a couple of examples which can be found here https://github.com/Unity-Technologies/2d-extras/tree/master/Assets/Tilemap/Tiles .

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 Kaskorian · Jul 26, 2018 at 05:59 PM 0
Share

Yes I know. So I have to edit the RuleTile Script. The problem is that I do not know how to read out the height of the wall, or more generally of the element (which I can indeed connect with others). Whenever I add another tile on the top or bottom, I have to check the entire wall. But how can I implement that?

avatar image wouter_v Kaskorian · Jul 30, 2018 at 08:52 PM 0
Share

I've never done it so i have no idea. You might want to look at the PrefabBrush at the GetObjectInCell method. This seems to get a gameobject of the tile depending on the position. That way you might be able to extrapolate how many are above and below it. If you find a solution i'd love to hear it.

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

88 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 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 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 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

tilemaps - prefab and tile issues 1 Answer

Anyone knows how to refresh tiles? 0 Answers

Tilemap color will only change to white, black, cyan, yellow or magenta. 0 Answers

Cannot assign the tile png to the tile asset file 0 Answers

Lines between Tiles when using Tile Palette (2021) 1 Answer


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