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 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 this 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 think 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 One$$anonymous$$inusSrcAlpha' 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.

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

Generated mesh has material under submeshes' materials 1 Answer

NavMesh issue with spawning players 3 Answers

Create roads on different meshes in Run time. 0 Answers

Duplicated NavMesh Agents not moving 0 Answers

How to create a spherical navigation? 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