• 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 kingcobra1986 · Dec 19, 2017 at 11:50 PM · meshnavmeshmaterialsnav mesh

How can I extract a mesh from the nav mesh?

I am trying to get a mesh from the nav mesh. The way that I have found is by:

 NavMeshTriangulation navMeshTriangluation = NavMesh.CalculateTriangulation();
 int[] triangles = navMeshTriangluation.indices;
 Vector3[] vertices = navMeshTriangluation.vertices;
 

Then I use AutoWeld from t$$anonymous$$s Unity answers page to remove the duplicates. But when I add a material of a grid square, it appears that uvs are so tight together, the object just shows the color of the grid lines.

I have also played around with High-Level NavMesh Building Components too and was unsuccessful.

I would just like a simple mesh extracted from the nav mesh and to be able to apply an material to it. Any ideas?

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 Buckslice · Dec 21, 2017 at 12:04 AM

I am guessing the navmesh doesn't generate or set up uvs correctly since they don't matter for navigation at all. Lucky for you I t$$anonymous$$nk Triplanar mapping would work great for your situation. Basically it just projects a texture onto your mesh from each cardinal direction without the need for uvs.

Comment
Add comment · Show 3 · 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 kingcobra1986 · Dec 22, 2017 at 08:20 PM 0
Share

@Buckslice I know little about shaders, when I use this it works except, when I use a transparent image, it shows black where it should be transparent. I tried changing render type to transparent and that didn't help. Do you know what else to modify?

avatar image Buckslice kingcobra1986 · Dec 23, 2017 at 02:18 AM 0
Share

Haven't tested this but I think you can just add 'Blend SrcAlpha OneMinusSrcAlpha' below the 'Zwrite On' line. Also make sure your texture is imported with alpha is transparency option.

avatar image kingcobra1986 · Dec 23, 2017 at 03:20 AM 0
Share

@Buckslice that was only part of it. I had to make x, y, and z a float4. I created a color variable for the tint with the value of 1,1,1,1 and in the surf function I added o.Alpha=z.a

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

85 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

Related Questions

Updating UV in imported mesh without having to re-material 0 Answers

How does assigning materials to MeshRenderer.sharedMaterials work? 1 Answer

Gaps in the Nav mesh 0 Answers

[Solved] Applying multiple materials to a generated mesh object 1 Answer

Can I use the UnityEngine namespace in a personal Application? 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