• 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 ExtremePowers · Feb 23, 2015 at 07:26 PM · terrainmeshdetailprototype

DetailPrototype

How do I add a DetailPrototype Mesh version at runtime? I have tried to fix this issue for a couple of days now, but can't seem to find a solution. Is this even possible if not I would love to know, so I can try to find a workaround instead. I have tried to assign the prototype value of the DetailPrototype. My code for generation of the detail prototypes:

     detailProtoTypes = new DetailPrototype[detail.Length];
         
     for (int d = 0; d < detail.Length; d++) {
         detailProtoTypes[d] = new DetailPrototype();
         detailProtoTypes[d].renderMode = DetailRenderMode.Grass;
         detailProtoTypes[d].prototype = detail[d];´
     }

I assign it later on. If I check in the Terrain Inspector it shows missing, and when I click edit on it, it is set to the normal detailprototype which doesn't take a GameObject as a parameter. (The one that takes a Texture)

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
2
Best Answer

Answer by ExtremePowers · Feb 24, 2015 at 07:05 PM

I finally got it working, I didn't know about the "DetailPrototype.usePrototypeMesh = value", since it wasn't documented, this could most certaintly be added to the documentation, as the prototype value depends on it.

Comment
Add comment · 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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

19 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

Related Questions

Can terrain detail meshes have basic shading applied? 1 Answer

Add Detail Mesh at runtime 1 Answer

To what extent can the tree system be used instead of the details system 0 Answers

Terrain detail meshes not appearing? 0 Answers

Terrain Detail Mesh Collisions 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges