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
0
Question by DeadKenny · Dec 25, 2014 at 09:42 PM · textureterrainarrayfloatterraintoolkit

Why cant I do this? Incorrect number of values(terrain and array related).

Ok so I am trying to paint my terrain procedurally but it only allows me to use 4 terrain textures.

I cant increase it at all, it says "incorrect number of values", whats happening? I tried adding more more heightstops but it didn't work either. I tried many things, all failed.

Here is the code:

         float[] sStops = new float[2];
         float[] hStops = new float[4]; //This has to be same number as terrain textures.
         
         sStops[0] = 0.1f;
         sStops[1] = 25.0f;
 
         
         hStops[0] = Random.Range(0.01f,0.015f);
         hStops[1] = Random.Range(0.08f,0.58f);
         hStops[2] = Random.Range(0.37f,0.98f);
         hStops[3] = Random.Range(0.71f,1.0f);
 
 
         this.gameObject.GetComponent<TerrainToolkit>().TextureTerrain(sStops, hStops, dTextures01);


So recap: This code above paints the terrain with the 4 textures in dtextures01 but I cant increase it to more than 4? How could I do that?

Thanks.

Comment
Add comment · Show 4
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 tanoshimi · Dec 26, 2014 at 07:40 PM 1
Share

This is not a limitation of Unity's terrain, but of whatever your "TerrainToolkit" component is. You'll have to look through that script and debug the error there.

avatar image Mmmpies · Dec 26, 2014 at 07:48 PM 1
Share

@tanoshimi is right, this isn't core Unity but if it helps any this is the code:

TTScript

Look at line 2453.

avatar image DeadKenny · Dec 26, 2014 at 08:02 PM 0
Share

Ok thanks dudes, that helps a lot. Hasn't solved it but it helps.

avatar image DeadKenny · Dec 28, 2014 at 02:21 PM 0
Share

It seems you can add 6 but then everything becomes incredibly bright... not even sure its working to be honest.

6 textures and 8 heightstops because 8/2 = 4+2 as seen in lines near 2453.

Eh, is nobody that knows about this?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Mmmpies · Dec 25, 2014 at 10:00 PM

Just watched an old tutorial and it says that you can add up to 6 but it also adds them in the inspector not in code. No idea if it helps but this is the tutorial.

[Tutorial][1]

That's for textures but I'm assuming you need the textures in order to set at which height it applies those textures. [1]: https://www.youtube.com/watch?v=YnO9RtarzHE

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 DeadKenny · Dec 25, 2014 at 11:12 PM 0
Share

Thanks will look at it. I need to sleep now, I'm brain dead atm.

avatar image DeadKenny · Dec 26, 2014 at 12:24 PM 0
Share

Doesn't really help, I tried using 6 only and still same error. Incorrect number of values for height stops. Even if I increase heightstops to 6.

I tried using a second pass with another 4, but I don't think its working. 99% sure.

I hope someone can help.

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

27 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

Related Questions

Terrain Toolkit and Texturing via Code HELP! 1 Answer

Getting error: ArgumentException: Destination array is not long enough to copy all the items in the collection. Check array index and length. 2 Answers

TerrainToolkit API - TextureTerrain doesn't work in full build 1 Answer

Keep height at edge TerrainToolkit 0 Answers

Normal maps using TerrainToolkit and Code? 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