Im trying to add aiming and Ive encountered a few problems
heres the code so far
void Aim()
{
if(Input.GetMouseButtonDown(1))
{
fpsCam.fieldOfView = 55f;
playerLook.mouseSensitivity = 50f;
rifle.position = rifleAimPos.position;
Debug.Log("Pistol is moving position");
pistolHolder.position = pistolAimPos.position;
Debug.Log("Pistol has moved");
}
else if(Input.GetMouseButtonUp(1))
{
fpsCam.fieldOfView = 70f;
playerLook.mouseSensitivity = 100f;
rifle.position = rifleStore.position;
pistolHolder.position = pistolHolderStore.position;
}
}
when i use this code, the rifle moves when you aim but the pistol never moves, it only changes the fov of the camera.
also, im trying to use lerp to smooth the transition but it wont work. it only moves on the z axis. ive made sure to set the pistol aim position to something else but it still wont move.
can anyone help me?
how do i lerp with positions