Hi!
I'm implementing custom editor script that will be used to massively place some objects on terrain, so I need to: 1) handle mouse clicks on terrain, 2) find position on which user have clicked on terrain.
I wonder how to do 1st task?
Hi!
I'm implementing custom editor script that will be used to massively place some objects on terrain, so I need to: 1) handle mouse clicks on terrain, 2) find position on which user have clicked on terrain.
I wonder how to do 1st task?
Use raycasting. A terrain has a collider on it by default, so you can raycast against it without any problem, and receive the position the ray hit it.
Try using the example in the manual: Collider.Raycast
Obviously you can use Physics.Raycast or whatever variant you want...