Select a face of an object ingame


I’m looking for a way to select individual faces/vertices in a mesh, based on my mouse position ingame, and then manipulate their coordinates. The idea in my project, is to increase or decrease the vertex/face distance in a given direction, from the world center.

Here’s the code I have so far:

function OnMouseOver(){
	   if (Input.GetMouseButton(0)) {
    	   // need code to select nearest Vertex of my mouse here.

I have done some searching, and similar questions have been asked in here, but they were not replied (and it is a long time ago), therefore I decided to ask again :slight_smile:

Have a look at the Sculpt Vertices in the procedural examples. From there you’ll figure out what to do.

Wow excellent breadcrumb! Thank you! :slight_smile:

Wow, excellent breadcrumb! :slight_smile: Thank you!