edit(Bunny83)
Copied and merged from comment:
var Firefrom : Transform;
var currentbrick: GameObject;
var finalbrick : GameObject;
;
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
var hit : RaycastHit;
var roundpos : Vector3;
if(Physics.Raycast(Firefrom.position, Firefrom.forward, hit))
{
//roundpos =
Debug.Log(hit);
roundpos = hit.point - Firefrom.forward.normalized * 0.05;
roundpos *= 2.0;
roundpos = Vector3(Mathf.Round(roundpos.x), Mathf.Round(roundpos.y), Mathf.Round(roundpos.z));
roundpos /= 2.0;
var Temp = Instantiate(currentbrick, roundpos , Quaternion.LookRotation(Vector3.zero));
if(Input.GetKeyDown(KeyCode.W))
{
Temp.tranform.position = Vector3(1,2,3);
}
}
}
}
The last part will not work, there is literaly no way to move the thing. (this isn’t full script)