This is the code :
var ray = CameraUI.ScreenPointToRay(Input.mousePosition);
var hit : RaycastHit;
if(Physics.Raycast(ray,hit)){
//Debug.Log("Now I see a cube");
if(hit.collider.tag == "RayEnemy" ){
Debug.Log("I see a unit");
if(Input.GetMouseButtonDown(0))Instantiate (particle, hit.point, transform.rotation);
The problem is that the particle instance is spawned somewhere related to the detected collider but if I move the camera I can see that in fact the particle instance is in mid air somewhere between collider and camera or around collider.
How can I spawn the particles (a lightning strike spell) right under collider position (on the ground under my unit because the collider is centered on the unit).
THanks