|
I'm making a game where the player has to draw lines. I'm using Graphics.DrawMesh, but I can't find a way to convert the line into a GameObject. I need it to be a GameObject because it needs to detect collisions. PS: This might be stupid, but I'm pretty new with Unity. Thanks in advance!
(comments are locked)
|
|
You will probably have to do it procedurally. Try something like this: var newObj : GameObject = new GameObject(objectName); newObj.AddComponent(MeshFilter); newObj.AddComponent(MeshRenderer); var mesh = new Mesh (); // <---- the mesh you created newObj.GetComponent(MeshFilter).mesh = mesh; Thanks a lot Jake!
Jul 10 '12 at 09:45 PM
kennyomar
(comments are locked)
|
