Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
3
Question by Quentin 2 · Dec 03, 2010 at 04:25 AM · meshcreateediting

How do you make mesh in Unity?

I know how to insert a mesh block or cyliner or whatever the different shapes are. I also know how to resize it. My question is though, how to youcan edit mesh and make it a custom shape?

P.S. Sorry if this seems like a dumb question to any of you. I just started using Unity a few days ago, and I'm still trying to familiarize myself with it.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
9

Answer by yoyo · Dec 03, 2010 at 07:14 PM

You can create Meshes procedurally, which is useful if your custom shapes can be generated from code.

See http://unity3d.com/support/documentation/ScriptReference/Mesh.html

You can even add custom menu handlers to the editor so that your shapes can be added just like the standard ones.

For "artistic" shapes, +1 to the Blender suggestion, I wouldn't try and program anything more complicated than a teapot if I were you! :-)

Comment
Add comment · Show 1 · 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 tachen · Dec 20, 2014 at 11:33 AM 0
Share

Thank you!

avatar image
8

Answer by Propagant · Nov 07, 2014 at 10:56 PM

Everything is about vertexes, triangles, edges, normals, UVs etc... Example:

 using UnityEngine;
 using System.Collections;
 
 public class Plane_Mesh_Script : MonoBehaviour {
 
     public Vector3[] Vertex = new Vector3[] 
     {
         new Vector3(0,0,0),new Vector3(1,0,0),new Vector3(0,1,0),new Vector3(1,1,0)
     };
 
     public Vector2[] UV_MaterialDisplay = new Vector2[] 
     {
         new Vector2(0,0),new Vector2(1,0),new Vector2(0,1),new Vector2(1,1) // 4 UV with all directions! (Plane has 4 uvMaps)
     };
 
     public int[] Triangles = new int[6]; // 2 Triangle combinations (2*3=6 vertices/vertexes)
 
     public Material material;
     
     void Start () {
 
         Triangles [0] = 0;
         Triangles [1] = 3;
         Triangles [2] = 1;
 
         Triangles [3] = 0;
         Triangles [4] = 2;
         Triangles [5] = 3;
 
         Mesh mesh = new Mesh ();
         transform.GetComponent<MeshFilter> ();
 
         if(!transform.GetComponent<MeshFilter> () ||  !transform.GetComponent<MeshRenderer> () ) //If you havent got any meshrenderer or filter
         {
             transform.gameObject.AddComponent<MeshFilter>();
             transform.gameObject.AddComponent<MeshRenderer>();
         }
 
         transform.GetComponent<MeshFilter> ().mesh = mesh;
 
         mesh.name = "MyOwnObject";
 
         mesh.vertices = Vertex;
         mesh.triangles = Triangles;
         mesh.uv = UV_MaterialDisplay;
 
         mesh.RecalculateNormals ();
         mesh.Optimize ();
         transform.gameObject.renderer.material = material; //If you want a material.. you have 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
avatar image
2

Answer by Peter G · Dec 03, 2010 at 04:32 AM

Unity is a game engine not a modeling program. So you cannot edit meshes in Unity.

If you are looking for a free modeler, Blender is always useful. Download 2.49 because 2.55 is still a beta, and didn't work well with Unity last time I checked.

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.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

'Pre-create object VS Create when needed' Performance difference 1 Answer

Problem creating a circle mesh 1 Answer

Creating a dynamic mesh with audio = crash after 30secs ? 0 Answers

Adding and removing specific triangles ? 1 Answer

How do I create a specific object in Unity? I need a planet with huge mountains and oceans. 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