- Home /
Detect click on dynamically generated mesh in Unity2d
Hi ! I am working on a simple game which requires dynamic generation of meshes of shape representing pipes in 2d. After cracking the problem of creating dynamic meshes now I am not getting how to detect click on this newly created mesh. Any suggestion/insight/solution/tips is highly appreciated ! Thanks a lot !
Answer by robertbu · Jan 31, 2014 at 04:22 PM
You need to add a mesh (or sphere, or box, or capsule) collider to the object.
gameObject.AddComponent(MeshCollider);
Your answer
Follow this Question
Related Questions
Problem with clicking to target enemies 1 Answer
Select un-selectable Objects with mouse. 1 Answer
Buttons still visible after Destroy() but say "deleted gameobject" in hierarchy 1 Answer
How to make an armour mesh fit on characters of differing heights and proportions? 1 Answer
Code Generated Plane Mesh 0 Answers