[FPS] Camera Recoil / Muzzle Climb - Script overriding?
For the longest time I've been avoiding any programming and only been writing code whenever needed, that's why I'm currently using uFPS - an FPS Base from the Asset Store - and I've gotten quite used to it.
But I'm not quite sure if "Camera Recoil / Muzzle Climb" - similar to this (https://www.youtube.com/watch?v=HsS0rtoj9l4) is a feature in uFPS, I've searched through the Asset Store and I've found an addon for uFPS that does the exact thing (https://assetstore.unity.com/packages/tools/camera/aaa-recoil-for-ufps-111555), but it costs - and I currently don't have the money to spare to buy it, or even sure if it works. :s
So as I usually - hate to - do, I decided to take on some basic unity C# courses and write it myself. As simple as this >testing< script is, I'm quite happy it works!
public Vector3 cameraRecoil;
// public float cameraRecoilMultiplier;
public GameObject camera;
// Use this for initialization
void Start () {
// cameraRecoil = cameraRecoil * cameraRecoilMultiplier;
}
// Update is called once per frame
void LateUpdate () { // Because Update wouldn't work, LateUpdate made me sure it was working
if (Input.GetMouseButtonDown(0))
{
camera.transform.rotation = camera.transform.rotation * Quaternion.Euler(cameraRecoil.x, cameraRecoil.y, cameraRecoil.z);
Debug.Log("Your shoulder or wrist has died!"); // Cheeky comment. :>
}
}
}
...buut I'm in a slump right now, the uFPS Camera Script seems to be taking over - rendering this script useless. I even disabled the uFPS Camera Script to make sure that the Recoil Script does in fact work.
I'd be REALLY forever grateful if you could help me find a work-around for this! - wish I wasn't this newbie with programming... x(
Your answer
Follow this Question
Related Questions
About mobile FPS Sprint 1 Answer
BasicFPS controller "Can not be loaded" 0 Answers
Angle calculation for raycast shotgun weapon ? 1 Answer
AimDownSights script not working 0 Answers
UNITY shooting script does nothing 1 Answer