Hi guys i know how to get the point on the terrain that my mouse has clicked but i wont to make that i can raise and lower the terrain(in the point i clicked) hear is the code to get the point on the terrain…
using UnityEngine;
using System.Collections;
public class DigSnow : MonoBehaviour {
public int rodentButton = 0;
public float rodentRange = 100f;
public string tagger = "terrain";
public GameObject prefab;
void Update(){
if(Input.GetMouseButtonDown(rodentButton)){
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if(Physics.Raycast(ray, out hit, rodentRange)){
if(hit.transform.CompareTag(tagger)){
Debug.Log(TerrainRenderFlags.heightmap);
//il punto dove si è toccato il mondo è hit.point
Debug.Log(hit.point);
Instantiate(prefab,hit.point,Quaternion.identity);
}
}
}
}
}