Hello. i am working on my weapon script and i have problem with aiming. well its not actual problem. here’s the thing… when i right click my weapon can aim but it just pop at aim position, i want to make it smooth go to my aim position.
var normalPos : Vector3;
var aimPos : Vector3;
var aimSpeed = 2.0;
function Update(){
if(Input.GetButton("Fire2")){
//When RightClicked, aim
transform.localPosition = Vector3.Lerp(transform.position, aimPos, aimSpeed);
}else{
transform.localPosition = Vector3.Lerp(transform.position, normalPos, aimSpeed);
}
}