Hello everyone, I have a problem. I simply want to make my camera’s near clipping plane after it has finished aiming. I was following ETeeski’s tutorials and got this line of code to aim :
if (Input.GetButton("Fire2")){
racioHipHold = Mathf.SmoothDamp(racioHipHold, 0, racioHipHoldV, hipToAimSpeed);
}
now that line makes it to aim, it’s OK. Now I want to change the near clipping planeso the gun would be invisible and I tried this :
if (Input.GetButton("Fire2")){
racioHipHold = Mathf.SmoothDamp(racioHipHold, 0, racioHipHoldV, hipToAimSpeed);
cameraObject.camera.nearClipPlane = 2;
}
it works but the problem is it makes nearClipPlane = 2 as soon as I click to Fire2 button. I don’t want that I just want to make it to change nearClipPlane after the first line of code, which is about aiming finished. I tried courutine but it causes other problems. Any ideas ?