Coordinates 3d for position of mouse ?

Hi people,

So, im new in Unity and I need to know how I can move an object to a specific point of a terrain when I click the mouse on this terrain, so, i need to know how I can capture the mouse 3d coordinates.

I read about “Raycast”, but i dont understand almost anything, someone has a well explained tutorial on this?

Sorry for my english (google translate).

Thanks.

Look up Camera.ScreenPointToRay(). You can perform a raycast using the ray to determine the intersection point (if any) with the terrain. (I don’t know off the top of my head if there’s any built-in support for raycasting against a terrain in Unity - maybe someone else can comment on that.)

Welcome to the forum, oginnam!

There is an example of raycasting from the camera in this thread.

thanks to both for their contributions. andee, your script is fine, this is enough for me.