- Home /
Question by
Hims · Jul 10, 2012 at 10:14 AM ·
errorraycastdrag and drop
Error in raycast using with drag drop of objects
i have put the following code in the mouse down function but if part of the code is not being executed , the purpose of this script is when user drag one object and drop it on another or put in strait of the other object the raycast should work and following script should be executed...
var hit : RaycastHit;
var ray : Ray = new Ray();
if(Physics.Raycast(ray,hit)){ Debug.Log("fkdohldsf"); if(hit.collider.gameObject.name.Equals("Roller1")) { Debug.Log("helloo"); } else { Debug.Log("else part"); }
}
Comment
Are you initialising the properties of that Ray somewhere?
Your answer
