Put this together, Need little help. the purpose of the script. Is you position the weapon camera (behind the sight) so it can appear your aiming.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Gun : MonoBehaviour
{
public GameObject weaponCamera = null; // this weapon camera
if (Input.GetButton("Fire2"))
{
if (weaponCamera)
{
weaponCamera.camera.enabled = true;
mainCamera.camera.enabled = false;
}
}
else
{
weaponCamera.camera.enabled = false;
mainCamera.camera.enabled = true;
}
}
