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 13, 2017 at 11:08 PM · materialimagenavmeshplane

How do I alter a plane to match the navMesh without altering the texture?

I creating a plane as the layer in which I can teleport to when using the SteamVR's interaction system. I created a Plane Object and attached the Teleport Area script to the plane. At this point the teleportation area shows a texture with a big square broken up into four little squares. This is because the plane is just a regular square. Now with the complete square, I could potentially teleport to an area under another object. I baked a navMesh and used the triangles from that and applied that to the plane with this code on Awake:

 NavMeshTriangulation triangles = NavMesh.CalculateTriangulation();
 mesh = GetComponent<MeshFilter>();
 mesh.mesh.vertices = triangles.vertices;
 mesh.mesh.triangles = triangles.indices;

Which this worked fine for creating the teleportable area, but the problem that I am having now is the texture. I would like to have the texture applied as the same way as it was with the square but not the missing "holes" in the square will not show that part of the texture. Here is an image of what I have in mind (It was drawn in paint real fast not done with precision): alt text The Normal Plane is how the plane looks before the transformation. The middle green block represents what the nav mesh looks like after it is baked. The third final picture is how I want the texture to look. I have it so the plane is in that shape but the texture is just a solid color (The color of the lines). I've tried changing the texture's wrap mode property to clamp and that didn't do it. I also tried to use mesh.mesh.uv = new Vector2[] = {Vector2.zero, Vector2.one}; and that didn't work either.

Does anyone have a solution to this? Also I would like to make it so that if the nav mesh changes, I don't have to change the code or anything.

maintainingtexture-placements.png (23.9 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

0 Replies

· Add your reply
  • Sort: 

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

86 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

Related Questions

Changing materials of a plane on keydown. 1 Answer

How do I use Material/Texture alpha on a plane? 2 Answers

How to apply mapped texture to material ? 1 Answer

Why is my image with a bump map so bad? 0 Answers

UI Image material did not get instanced. Why? 0 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