I need to draw box that starts at Input.GetMouseButtonDown(0) postilion and will continue to render,change and follow the mouse position until Input.GetMouseButtonUp(0). It will only be for looks, but i am not sure how to approach this problem.
You would do something like this. I have a code that instantiates a object somewhere the mouse is located, but it needs to hit something first. Its not exactly what you want but it should give you ideas. If you need more help let me know.
var particle : GameObject;
function Update () {
if (Input.GetMouseButtonDown (0)) {
// Construct a ray from the current mouse coordinates
var ray : Ray = camera.ScreenPointToRay (Input.mousePosition);
var hit : RaycastHit;
if (Physics.Raycast( ray, hit, 1900)) {
// Create a particle if hit
Instantiate (particle, hit.point) , transform.rotation);
}
}
}